Mixing different types of LP shares can lead to losses for Synth holders
Synth minters do not receive pool shares, so a liquidity provider can withdraw all pool assets, leaving Synth holders unable to redeem their funds. An attacker could exploit this by minting a Synth after an LP deposit and then having the LP withdraw everything.
Submitted by hyh
Impact
Users that mint Synths do not get pool shares, so exiting of normal LP can lead to their losses as no funds can be left for retrieval.
Proof of Concept
3 types of mint/burn: NFT, Fungible and Synths. Synths are most vilnerable as they do not have share: LP own the pool, so Synth’s funds are lost in scenarios similar to:
- LP deposit both sides to a pool
- Synth deposit and mint a Synth
- LP withdraws all as she owns all the pool liquidity, even when provided only part of it
- Synth can’t withdraw as no assets left
burn NFT LP: https://github.com/code-423n4/2021-11-vader/blob/main/contracts/dex-v2/pool/BasePoolV2.sol#L270
burn fungible LP: https://github.com/code-423n4/2021-11-vader/blob/main/contracts/dex-v2/pool/VaderPoolV2.sol#L374
Recommended Mitigation Steps
Take into account liquidity that was provided by Synth minting.
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 pool's accounting does not reserve liquidity for Synth minters, so LP withdrawals can drain all assets.
Impact
Synth holders could lose their funds because a liquidity provider can withdraw all pool assets, leaving nothing for Synth redemption.
What the attacker needed
LP deposits to pool; Synth minting occurs; LP withdraws all
The fix
The pool should account for liquidity provided by Synth minting so that Synth holders can always redeem their funds.
How it was found
- LP deposits both sides to a pool
- Synth deposit and mint a Synth
- LP withdraws all as she owns all the pool liquidity
- Synth can’t withdraw as no assets left
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.
In a liquidity pool, people deposit assets and get shares representing their portion. Here, users who mint Synths deposit assets but get no shares, so a normal liquidity provider can withdraw all assets, leaving Synth minters with nothing to redeem.
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.