if the STADIUM_ADDRESS got blacklisted by the token it will be impossible to get the fee tokens from the proxy contract and all the functions of the proxy will be frozen and revert all time which will lead to a loss of funds for the protocol and users .
Some tokens (e.g. USDC, USDT) have a contract level admin controlled address blocklist. If an address is blocked, then transfers to and from that address are forbidden , so if the STADIUM_ADDRESS get blocklisted for any reason this will lead to freeze all the functions the responsible for distribution of the reward which lead to lock all the funds and fee tokens inside the proxy contract , which is a huge loss of funds .
and if the protocol tried to deploy a new implementation contract ,all the locked funds will keep locked because the implementation can only be set once inside the proxy contract .
in the Distributor contract, the function distribute() call the internal function _commissionTransfer() which send the fee tokens to the STADIUM_ADDRESS , as shown here
https://github.com/Cyfrin/2023-08-sparkn/blob/0f139b2dc53905700dd29a01451b330f829653e9/src/Distributor.sol#L116-L156
sending the fee tokens to the STADIUM_ADDRESS here :
https://github.com/Cyfrin/2023-08-sparkn/blob/0f139b2dc53905700dd29a01451b330f829653e9/src/Distributor.sol#L163-L165
if the function _commissionTransfer() reverts the distribute() will also revert which prevent the winners from getting their rewards and also prevent the owner from rescuing the tokens , which cause the all funds to be locked forever .
this vulnerability will prevent the winners from getting their rewards , and the protocol from taking the fee ,and also prevent the owner from rescuing the tokens , which cause the all funds to be locked forever .
manual review
there are two possible mitigation methods (the second is the favorable) :
1)adding a function to set (change) the implementation inside the proxy and allow only the factory to call this function ,
and then add this function to the factory contract and allow only the owner to set the new implementation , and prevent all the other function in the factory from calling this setImplemntation() function , by reverting in case of the selector is the selector of this function
add this function in the proxy
and this function in the factory
2)add the setImplementation function in the proxy and allow only the owner of the factory contract to call it
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.