Skip to content
Business logic Audit finding Intermediate

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.

hyh Follow

Originally disclosed on Code4rena

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:

  1. LP deposit both sides to a pool
  2. Synth deposit and mint a Synth
  3. LP withdraws all as she owns all the pool liquidity, even when provided only part of it
  4. 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.

SamSteinGG (Vader) confirmed

The original report as published on Code4rena, by hyh. Images and videos are our own copies; raw HTML is shown as text. View it on Code4rena.

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

  1. LP deposits both sides to a pool
  2. Synth deposit and mint a Synth
  3. LP withdraws all as she owns all the pool liquidity
  4. 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.

More by hyh

View all

137 more disclosed reports, best first.

More from Vader Protocol contest

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.