The contract deployment method in the ReseedBean contract does not consider potential re-org attacks.
It uses the create2 opcode with fixed salt values, which does not include the msg.sender.
This approach makes the contract deployments vulnerable to re-org attacks, especially on EVM-compatible L2 solutions like Arbitrum and Polygon, which are more susceptible to re-org events.
In the current implementation, the ReseedBean contract deploys other contracts using the ERC1967Proxy
with a fixed salt. For example:
This method does not incorporate msg.sender into the salt, making the derived contract address solely
based on the factory's nonce and the fixed salt. Consequently, it does not mitigate the risk of re-org
attacks effectively.
This is also existential in deployBean, deployUnripeBean, deployUnripeLP, deployBeanEthWell.
Contracts deployed using the current method are vulnerable to re-org attacks. Re-orgs, or chain
reorganizations, can occur across all EVM chains but are more frequent on EVM-compatible L2 solutions
such as Arbitrum and Polygon. Ethereum, a primary deployment target, has already experienced re-org events.
During re-org events, transactions that were once included in a block may be reverted.
When re-executed, the nonce of the factory contract could have changed, causing the contract address derived
from create2 to differ from the expected address.
EVM-compatible L2 solutions are more susceptible to re-org events due to their inherent design.
Deploying contracts on such chains without addressing the re-org vulnerability can lead to inconsistent
deployment patterns and unexpected contract addresses.
Re-org attacks can be exploited by malicious actors to disrupt the deployment process, potentially leading to denial of service
or other security issues.
Manual Review
To mitigate the risk of re-org attacks and enhance the security of contract deployments,
it is recommended to use create2 with a dynamically generated salt that includes msg.sender.
This approach ensures that the derived contract address is more predictable and less prone to
unexpected changes due to re-orgs.
The deployment functions in the ReseedBean contract should be modified to include msg.sender in the salt, as shown below:
By incorporating msg.sender in the salt, the contract addresses are no longer solely dependent on the factory's nonce and a fixed salt, thereby enhancing security against re-org threats and ensuring more consistent deployment patterns in line with CREATE2.
Invalid as per docs https://docs.codehawks.com/hawks-auditors/how-to-determine-a-finding-validity
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.