Open codehawks-bot opened 1 year ago
Why this report is not selected ? It even contains a POC while current selected one's don't. @PatrickAlphaC said this if POC contained report is present then it will be selected over non POC contained. I think it should be selected over the current selected one.
But it should be invalid, because the developers said that the owner and the organizers will be trusted, and cannot be malicious
Organizer
can be malicious and transfer 95% of the funds from Contest contract to himself by passing only himself in winners array.Severity
High Risk
Relevant GitHub Links
https://github.com/Cyfrin/2023-08-sparkn/blob/main/src/ProxyFactory.sol#L127C5-L138C6
Summary
Organizer
can be malicious and transfer 95% of the funds from Contest contract to himself by passing only himself in winners array. Other 5% transferred toSTADIUM_ADDRESS
as Fee.Vulnerability Details
Organizer
callsdeployProxyAndDistribute
of ProxyFactory.sol and pass only himself in winners array in encoded bytes data and call this function. This calls's proxy and proxy delegates the call toDistributor.sol
its implementation and distribute the 95% of the total collected amount for winners in the Contest. In this case onlyOrganizer
passes himself in winners array indistribute
function ofDistribute.sol
so 95% of funds of the contest will transfer toorganizer
.Relevant Code links
https://github.com/Cyfrin/2023-08-sparkn/blob/main/src/ProxyFactory.sol#L127C5-L138C6
https://github.com/Cyfrin/2023-08-sparkn/blob/main/src/Proxy.sol#L51C5-L63C10
https://github.com/Cyfrin/2023-08-sparkn/blob/main/src/Distributor.sol#L92C5-L99C6
https://github.com/Cyfrin/2023-08-sparkn/blob/main/src/Distributor.sol#L128C7-L150C14
POC:
Change these below newly added lines in
ProxyFactoryTest.t.sol
and you can see at last 95% of total contest fund of 10000 tokens transferred to organizer. Other 5% transferred toSTADIUM_ADDRESS
as Fee.Impact
95% out of all the funds given by sponsors to contest can be stolen by Organizer.
Tools Used
Manual review and Foundry
Recommendations
Add mapping or array to store all the supporters and make sure the winners is chosen from those supporters only all sponsors see those supporters on UI.