Open c4-bot-6 opened 6 months ago
Hey @Picodes, This issue has just two comments in the validation repo, one agree, one not.
But this is a common issue and is been validate as a medium in other contest too, deterministic salt allow an attacker to front run the perform transaction and make revert.
the rollup proxy is deployed by the upgrade executor, so even though the attacker knows the salt they can't deploy to the same address
Lines of code
https://github.com/code-423n4/2024-05-arbitrum-foundation/blob/6f861c85b281a29f04daacfe17a2099d7dad5f8f/src/rollup/BOLDUpgradeAction.sol#L516
Vulnerability details
The
perform
function is used to make the upgrade from the old protocol to the new protocol, is in charge to create the config, make the deploys and initialize the contracts:[Link]
The problem is that the
RollupProxy
is been create by the CREATE2 opcode as the salt is deterministic an attacker can create a contract with the same salt and make the execution fail.Impact
The upgrade process can be halted by an attacker
Proof of Concept
see the
perform
function:[Link]
The salt used is
keccak256(abi.encode(config))
see the createConfig():[Link]
As you can see an attacker can craft the config since all the values are deterministic, deploy the contract with this salt an then the
perform
function is gonna failTools Used
Manual
Recommended Mitigation Steps
The best solution that i can think is make the deployment apart of the
perform
function and put the address of the deploy as a input.another solution is add the msg.sender to the salt with a some kind of nonce, chainlink vrf, between others.
Assessed type
Other