Tokens are pulled from users without verifying pool status contrary to requirement #15
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
edited-by-warden
M-02
primary issue
Highest quality submission among a set of duplicates
🤖_01_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
sufficient quality report
This report is of sufficient quality
Lines of code
https://github.com/code-423n4/2024-10-superposition/blob/7ad51104a8514d46e5c3d756264564426f2927fe/pkg/seawater/src/lib.rs#L679-L687
https://github.com/code-423n4/2024-10-superposition/blob/7ad51104a8514d46e5c3d756264564426f2927fe/pkg/seawater/src/lib.rs#L716-L738
Vulnerability details
Proof of Concept
Both the
update_position_internal()
andadjust_position_internal()
functions are responsible for managing token positions, which involves taking tokens from users. However, there is a critical inconsistency in how each function verifies the operational status of the liquiditypool
before performing token transfers from the user.update_position_internal()
This function checks if the
pool
isenabled
before taking tokens from the user.adjust_position_internal()
This does not explicitly check whether the
pool
isenabled
before proceeding.First, it calls
self.pools.setter(pool).adjust_position(...)
which has the following comment:The comment in the
adjust_position()
function implies that a check for the pool's operational state is necessary and should be enforced inupdate_position()
. However,update_position()
function does not make such enforcement as it does not check for pool status.Impact
Users could unintentionally have their tokens adjusted or transferred to a pool that is not operational which is not in accordance with protocol requirement. This also exposes users to risks in the event that there are potential issues with the pool.
Recommended Mitigation Steps
Modify the
adjust_position_internal()
function to include a status check before executing the position adjustment:// Ensure the pool is enabled before making any adjustments + assert_or!(pool.enabled.get(), Error::PoolDisabled);
Assessed type
Other
The text was updated successfully, but these errors were encountered: