Users can't remove liquidity while a pool is disabled #31
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
M-08
primary issue
Highest quality submission among a set of duplicates
🤖_59_group
AI based duplicate group recommendation
satisfactory
satisfies C4 submission criteria; eligible for awards
selected for report
This submission will be included/highlighted in the audit report
sponsor confirmed
Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
sufficient quality report
This report is of sufficient quality
Lines of code
https://github.com/code-423n4/2024-08-superposition/blob/4528c9d2dbe1550d2660dac903a8246076044905/pkg/seawater/src/lib.rs#L688-L727
Vulnerability details
Impact
There is a functionality for disabling a pool in case of unforeseen circumstances or if a problem occurs. While the pool is disabled the users should not be able to do certain actions but removing their liquidity should not be one of them.
When a problem occurs in the pool, users should be able to remove their liquidity, as it may be at risk and they may lose their money. The problem is there is a check that does not allow them to do it.
Proof of Concept
update_position_internal
has a comment that states "Requires the pool to be enabled unless removing liquidity.", meaning that there should be a check for the pool status only when liquidity is added and the users should be allowed to remove their liquidity if the pool is not active.But
update_position_internal
callsupdate_position
that is used to add or remove liquidity from a position and the function has this check:The check above prevents the function from being called when the pool is disabled, which is understandable in case users want to add liquidity to the pool when there is a problem.
However, users don't want their money to be at risk and they would want to remove their funds but they can't because of that check.
Tools Used
Manual Review
Recommended Mitigation Steps
If the passed
delta
is negative, it means the user is removing liquidity, so check the pool's status only when thedelta
is positive.Assessed type
Access Control
The text was updated successfully, but these errors were encountered: