bin2chen - initialize() DOS attack by very big l2BlockNumber #44
Labels
Duplicate
A valid issue that is a duplicate of an issue with `Has Duplicates` label
Medium
A valid Medium severity issue
Reward
A payout will be made for this issue
Sponsor Confirmed
The sponsor acknowledged this issue is valid
Won't Fix
The sponsor confirmed this issue will not be fixed
bin2chen
medium
initialize() DOS attack by very big l2BlockNumber
Summary
Maliciously specifying
l2BlockNumber == type (uint256).max
may block subsequentGame
initializationVulnerability Detail
Currently
FaultDisputeGame.initialize ()
will limit not less than or equal to the previousl2BlockNumber
And when DEFENDER_WINS will update
root = l2BlockNumber
In this way, the user can submit a
l2BlockNumber == type (uint256).max
, and it is a correctrootClaim
When DEFENDER_WINS, OutputRoot.root is changed to
type (uint256).max
In this way, subsequent
Game
will revert toUnexpectedRootClaim
initialization failure.Impact
Block subsequent
Game
initializationCode Snippet
https://github.com/sherlock-audit/2024-02-optimism-2024/blob/main/optimism/packages/contracts-bedrock/src/dispute/FaultDisputeGame.sol#L539
Tool used
Manual Review
Recommendation
cancel
<= rootBlockNumber
limitfunction initialize() public payable virtual { ... - if (l2BlockNumber() <= rootBlockNumber) revert UnexpectedRootClaim(rootClaim()); // Revert if the calldata size is too large, which signals that the `extraData` contains more than expected. // This is to prevent adding extra bytes to the `extraData` that result in a different game UUID in the factory, // but are not used by the game, which would allow for multiple dispute games for the same output proposal to // be created. // Expected length: 0x66 (0x04 selector + 0x20 root claim + 0x20 l1 head + 0x20 extraData + 0x02 CWIA bytes) assembly { if gt(calldatasize(), 0x66) { // Store the selector for `ExtraDataTooLong()` & revert mstore(0x00, 0xc407e025) revert(0x1C, 0x04) } }
Duplicate of #90
The text was updated successfully, but these errors were encountered: