Links
SpiceAuctionFactory.sol uses the CREATE
deploy a SpiceAuction.sol, since the new keyword is being used for the deployment, this method however leaves the approach susceptible to a re-org attack.
The createAuction
function in SpiceAuctionFactory.sol allows the admins to deploy a new SpiceAuction contract. This method uses the new
keyword when deploying, which makes it susceptible to a re-org attack, which means an attacker can take control of the to-deploy contract while the chain is down/ or the re-org is going on, considering protocol is to be deployed on ethereum and any EVM, including optimistic ones so the chances of this occurring are higher than average.
For reference links for some previous reorgs that happened in the past:
Ethereum: https://decrypt.co/101390/ethereum-beacon-chain-blockchain-reorg
Polygon:
https://protos.com/polygon-hit-by-157-block-reorg-despite-hard-fork-to-reduce-reorgs/ - February last year, 157 blocks depth
Optimistic rollups (Optimism/Arbitrum) are also vulnerable to reorgs since if someone finds a fraud the blocks will be reverted, even though the user receives a confirmation. These are the biggest events of reorgs that happened, here is a link for forked blocks, which means excluded blocks as a result of "Block Reorganizations" on Polygon: https://polygonscan.com/blocks_forked?p=1, where can be observed that at least two-digit block reorgs happen every month.
The deployment method of the SpiceAuction contract is unsafe considering a re-org attack would allow an attacker take over the contract, and potentally steal transferred funds from it. Any user that relies on the address derivation in advance, any funds/tokens sent to it could potentially be lost as the newly deployed SpiceAuction contract will be different from the address they had derived and had sent funds to .
Manual Review
Consider using create2
and a non-constant salt
value when deploying.
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.