Inadequate Check in removeLiquidityProportional
Allows Malicious Attacker to Withdraw More Than Their Deposit
The removeLiquidityProportional
function lacks proper validation of withdrawal amounts, allowing malicious attackers with minimal deposits to exploit the system and withdraw more than they are entitled to.
Here's the implementation of removeLiquidityProportional
function in UpliftOnlyExample
contract:
As demonstrated, the removeLiquidityProportional
function verifies if the caller has deposits in the specified pool by checking the length of poolsFeeData[msg.sender]
.
However, this check can be bypassed if an attacker makes a minimal deposit. Once bypassed, the attacker can exploit the vulnerability to withdraw excessive funds from the pool, potentially draining it entirely.
The inadequate validation in the removeLiquidityProportional function allows attackers to bypass checks by making minimal deposits. This enables them to exploit the system and withdraw excessive funds, potentially draining the entire pool and causing significant financial losses to the protocol and its users.
Manual Review
Implement stricter validation in the removeLiquidityProportional
function to ensure that withdrawal amounts are directly correlated to the user's actual deposit.
Read bugs with that tag: invalid_onAfterRemoveLiquidity_loop_underflow Because of that implementation, trying to remove more will lead to an underflow.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.