The SpiceAuction contract's recoverToken function has a vulnerability that permits the recovery of the auction's own tokens, known as "spice tokens," especially when they are proxied tokens with multiple addresses. This oversight enables the DAO executor, who controls the proxied token, to misuse the function to withdraw funds from the SpiceAuction contract illicitly.
The recoverToken function checks if the token being recovered is the spice or templeGold token and stops the transfer if the auction is not ended yet or if there are unclaimed amounts of auction token yet. However, if the spiceToken is a proxied token with multiple delegated addresses, the owner can simply call recoverToken for a second address and empty funds. Although the DAOExecutor contract is trusted to some degree, since it is a governance contract it still can't be completely trusted, and it's safer to change this so that no one can empty the main Auction token.
Users' funds can be stolen, affecting participants who bid or contribute to auctions.
The auction mechanism may be compromised, preventing rightful winners from claiming prizes or receiving rewards.
Make following changes to SpiceAuctionTestBase contract defining two token proxies and one main proxied token, Also add _getAuctionConfig2 internal function for case that isTempleGoldAuctionToken = false and spiceToken is the Auction Token.
Finally, add the following test to SpiceAuctionTest test contract: exploit steps:
Create one ProxiedToken with two delegators
Create auction using proxy address 1
Auction starts
Alice bids 10 templeGold
Auction still active attempt to recover using proxy address 2, recover is successful and whole contract is emptied from auction tokens
Auction ends
Alice tries to claim but fails to do it because of insufficient funds
Manual Review
add the following checks to the recoverToken function to mitigaite this issue, the second check for templeGold is optional becuase it can be trusted. and probably doesnt have proxied addresses.
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.