Attacker can claim more IL by manipulating pool price then removeLiquidity
The Vader protocol reimburses impermanent loss (IL) immediately upon withdrawal, and the IL calculation uses the current pool balance, which an attacker can manipulate. An attacker who owns most of a pool could swap to skew the balance, remove liquidity to receive an inflated IL reimbursement, and then restore the balance, profiting at the protocol's expense.
Submitted by gzeon
Impact
Vader reimburse user IL immediately when user withdraw from the pool (VaderRouterV2.sol:L227), an attacker can therefore manipulate the pool balance causing a high IL, remove liquidity and restore the pool balance such that he will receive a larger IL reimbursement.
Proof of Concept
Let’s assume our attacker own 100% of FOO-VADER
-
Attacker add 100 FOO and 100 VADER to the Pool
-
wait some block, or 1 year for max IL protection
-
In 1 transaction, attacker
- Swap 9900 FOO to 99 Vader
- Pool now have 10000 FOO and 1 VADER
- By VaderMath.sol:L84 the loss is 100*1/10000+100-2 = 98.01 VADER
- Remove liquidity and receive 10000 FOO and 99.01 VADER
- Restore the pool balance
-
Such that the attacker will gain 98.01 VADER without risk
The profit is constrained by gas cost, pool fee, % of pool controlled by the attacker and % of IL protection.
Recommended Mitigation Steps
Use twap price to determine P1 in VaderMath.sol:L84 when calculating IL to reduce risk of manipulation
Duplicate of #2
Doesn’t seem like a duplicate to me, @SamSteinGG?
@alcueca The stated trade cannot occur as trades are inherently limited by the CLP design of the protocol to one third of the available pair liquidity. As such, the illustrated pair would actually result in almost zero units retrieved back.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the IL reimbursement calculation uses the instantaneous pool balance rather than a time-weighted average price, allowing manipulation within a single transaction.
Impact
An attacker could gain tokens without risk, though the profit is limited by gas cost, pool fee, the share of the pool controlled, and the IL protection percentage; the protocol team also stated that trades are capped at one third of available liquidity, which would reduce the effect.
What the attacker needed
Own a large share of the pool; wait for IL protection period; pay gas and pool fees
How it was found
- Attacker adds liquidity to the pool.
- Attacker waits for the maximum IL protection period.
- Attacker swaps a large amount to skew the pool balance.
- Attacker removes liquidity and receives an inflated IL reimbursement.
- Attacker restores the pool balance.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
When you add money to a liquidity pool, you can suffer 'impermanent loss' if the price of the two tokens changes relative to each other. Vader promises to pay you back for that loss when you withdraw. The report says the payout is based on the pool's current balance, which an attacker can temporarily distort with a large trade, withdraw at a fake loss, and then undo the trade, leaving the protocol to cover a loss that never really happened.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.