-
Notifications
You must be signed in to change notification settings - Fork 4
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
Lp's liquidity may be lost if re-org happens #62
Comments
We're going to resolve this by deleting the burn position feature. |
The Warden has identified a mechanism in the Seawater system that can become harmful if a re-organization occurs, leading to a total loss of the funds associated with the position. I believe a medium risk severity rating is appropriate given the likelihood of a re-organization simultaneously occurring with the sequence of events outlined (i.e. different blocks that ended up being re-ordered executing the actions outlined) is low. |
alex-ppg marked the issue as satisfactory |
alex-ppg marked the issue as selected for report |
Arbitrum's docs states that a transaction can't be re-orged, so this should be invalid. |
Yeah, there are no re-orgs in Arbitrum - https://abarbatei.xyz/blockchain-reorgs-for-managers-and-auditors#heading-metrics-for-protocols-and-auditors |
Hey @0xSilvermist and @blckhv, thank you for your PJQA contributions. The documentation referenced states that if the L1 re-orgs, then the Arbitrum transactions will re-org as well. This is also referenced in the glossary itself. The link referenced by @blckhv also does not say that "re-orgs are not possible", simply that they have not been observed yet. As such, the original ruling of the submission stands. |
Hey @alex-ppg, I believe there is a difference between the re-org that can happen in Arbitrum vs Polygon, for example. Re-orgs in Arb are only if the sequencer is offline and then the only thing that will re-org are the transactions submitted the moment before the sequencer went offline before force-included ones. We discussed the same topic in a recent contest and concluded that it can't happen: https://codehawks.cyfrin.io/c/2024-07-zaros/s/427 The docs that you provided summarises the same thing: https://docs.arbitrum.io/intro/glossary#reorg |
Lines of code
https://github.com/code-423n4/2024-08-superposition/blob/4528c9d2dbe1550d2660dac903a8246076044905/pkg/seawater/src/lib.rs#L529-L543
Vulnerability details
Impact
LP holders will remove liquidity and then burn their liquidity position. If re-org happens, malicious users can manipulate the pool's price to cause user's removing liquidity revert. Then LP holders' position will be burned and liquidity will be locked in contract.
Proof of Concept
In lib.rs, users can burn their position. From this function's comment,
Calling this function leaves any liquidity or fees left in the position inaccessible.
, it's users' responsibility to remove their liquidity before they burn their position.The problem is that even if users follow this rule, remove liquidity at first, and then burn their position, users may still lose their funds.
Re-org is one common scenario in Arbitrum. When re-org happens, some transactions will be re-ordered and re-executed.
For example:
Tools Used
Manual
Recommended Mitigation Steps
Add some more check on burn_position_AE401070(), revert if there are some left liquidity.
Assessed type
Context
The text was updated successfully, but these errors were encountered: