Attacker can "retrieveDeposit" then "redeemDeposit" with a future nonce to freeze the assets of subsequent depositers #310
Labels
3 (High Risk)
Assets can be stolen/lost/compromised directly
bug
Something isn't working
duplicate-688
satisfactory
satisfies C4 submission criteria; eligible for awards
Lines of code
https://github.com/code-423n4/2023-05-maia/blob/54a45beb1428d85999da3f721f923cbf36ee3d35/src/ulysses-omnichain/RootBridgeAgent.sol#L1140-L1156
Vulnerability details
Impact
Attacker can call
retrieveDeposit
with a future deposit nonce andanyFallback
will be triggered to set the deposit status to Failed. Then, the attacker callsredeemDeposit
to deletegetDeposit[_depositNonce]
. When a unlucky depositer makes a deposit with that nonce, everything will go as usual on branch chain, except thatexecutionHistory[fromChainId][nonce]
has already been marked as true on root chain. As a result, the root chain transaction willforcerevert()
and the depositer has no way to get their assets back.Proof of Concept
Tools Used
Manual Review
Recommended Mitigation Steps
Add a check in
retrieveDeposit
:Assessed type
Invalid Validation
The text was updated successfully, but these errors were encountered: