-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RootBridgeAgent.redeemSettlement
can be front-run using RootBridgeAgent.retrySettlement
causing redeem DoS
#869
Comments
trust1995 marked the issue as primary issue |
trust1995 marked the issue as satisfactory |
Despite the user being still entitled to his assets and able to call retry with gas and redeem, this would allow anyone to grief a user's failed settlement causing the user to spend unnecessary time/ gas and if the economic incetives exist this could be done repeatedly. As this is completely undesired, we will add settlement owner verification to |
0xBugsy marked the issue as sponsor confirmed |
trust1995 marked the issue as selected for report |
Frontrunning is not possible on root chain (Arbitrum) as there is no mempool and the Arbitrum Sequencer orders transactions on a first come, first served basis. Refer to Arbitrum docs at https://developer.arbitrum.io/learn-more/faq#will-transactions-with-a-higher-gas-price-bid-be-confirmed-first |
I partially agree, however the affected contract is part of the Ulysses Omnichain system and therefore not limited to Arbitrum. |
Thanks for clarification. Agree with the point that it extends beyond Arbitrum. |
Lines of code
https://github.com/code-423n4/2023-05-maia/blob/54a45beb1428d85999da3f721f923cbf36ee3d35/src/ulysses-omnichain/RootBridgeAgent.sol#L243-L268
Vulnerability details
Impact
Since RootBridgeAgent.retrySettlement(...) can be called by anyone for any settlement, a malicious actor can front-run an user trying to redeem his failed settlement via RootBridgeAgent.redeemSettlement(...) by calling RootBridgeAgent.retrySettlement(...) with
_remoteExecutionGas = 0
in order to make sure that this settlement will also fail in the future.As a consequnce, the user's subsequent call to RootBridgeAgent.redeemSettlement(...) will revert (DoS) because the settlement was already marked with
SettlementStatus.Success
during the malicious actor's call to RootBridgeAgent.retrySettlement(...). Therefore the user is unable to redeem his assets.Proof of Concept
The following PoC modifies an existing test case to confirm the above claims resulting in:
SettlementStatus.Success
.Just apply the diff below and run the test with
forge test --match-test testRedeemSettlement
:Tools Used
VS Code, Foundry
Recommended Mitigation Steps
I suggest to only allow calls to RootBridgeAgent.retrySettlement(...) by the settlement owner:
Assessed type
DoS
The text was updated successfully, but these errors were encountered: