Closed c4-submissions closed 1 year ago
0xA5DF marked the issue as primary issue
0xA5DF marked the issue as sufficient quality report
0xBugsy (sponsor) confirmed
alcueca marked the issue as satisfactory
alcueca marked issue #397 as primary and marked this issue as a duplicate of 397
Lines of code
https://github.com/code-423n4/2023-09-maia/blob/f5ba4de628836b2a29f9b5fff59499690008c463/src/RootBridgeAgent.sol#L1090
Vulnerability details
Impact
When encoding a payload for settlement of multiple tokens, the fallback flag is not set when it should be. This will cause no fallback to be triggered even though the user has paid enough to cover the additional costs that are required.
Proof of Concept
In
RootBridgeAgent._createSettlementMultiple
the function ID which contains the fallback flag as first bit is encoded like this:This bitwise AND of 0x02 with 0x0F will yield 0x02 (same as the no fallback case). Hence no fallback will be triggered in case of failure on the branch chain:
Minimal PoC with foundry to showcase
0x02 & 0x0F == 0x02
:Tools Used
Manual Review
Recommended Mitigation Steps
Looking at how
RootBridgeAgent._createSettlement
determines the first byte:This should be done analoguously for
_createSettlementMultiple
Assessed type
Other