The onAfterRemoveLiquidity function in the UpliftOnlyExample contract is vulnerable to unauthorized invocation due to insufficient caller validation. While the function employs an onlySelfRouter modifier, it does not ensure the expected execution flow. This oversight allows attackers to manipulate the function using external smart contracts, potentially resulting in unauthorized token burns, fee manipulation, or asset loss for legitimate users.
Insufficient Caller Validation: The onlySelfRouter modifier only verifies that address(this) is the set router, but it does not check if the invocation follows the intended execution sequence from the Vault contract.
Using the unlock function in the Vault contract, the attacker provides arbitrary parameters to trigger onAfterRemoveLiquidity.
This leads to unauthorized burning of LP tokens, manipulation of fees, or even redistribution of fees in ways that harm legitimate users.
Attacker contract
Attack test
Denial of Service: Malicious burning of legitimate users’ LP tokens prevents them from withdrawing liquidity.
manual auditing
Add the only vault modier to the onlyVault modifier to the onAfterRemoveLiquidity contract
Likelihood: High, anyone, anytime. Impact: High, Loss of funds
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.