Skip to content
Business logic Audit finding Intermediate

Attacker can get extremely cheap synth by front-running create Pool

The createPool function is permissionless, allowing an attacker to create a pool for a new token and set an extremely cheap price by depositing a tiny amount of the token and a large amount of Vader. The attacker can then mint a large amount of synthetic asset at that cheap price, and there is no way to revoke the pool, making the legitimate pool invalid.

jonah1005 Follow

Originally disclosed on Code4rena

Submitted by jonah1005, also found by defsec

Impact

createPool is a permissionless transaction.

  1. Anyone can create a token pool.
  2. Token price is set by the first lp provider.
  3. User can get a synthetic asset.

Assume a new popular coin that the DAO decides to add to the protocol. The attacker can create the pool and set it to be extremely cheap. (By depositing 1 wei coin and 10^18 wei Vader.) The attacker can mint a lot of synth by providing another 10^18 wei Vader.

There’s no way to revoke the pool. The coin pool would be invalid since the attacker can drain all the lp in the pool.

I consider this is a high-risk issue.

Proof of Concept

Tools Used

None

Recommended Mitigation Steps

Restrict users from minting synth from a new and illiquid pool. Some thoughts about the fix:

  1. Decide minimum liquidity for a synthetic asset (e.g 1M Vader in the pool)
  2. Once there’s enough liquidity pool, anyone can deploy a synthetic asset after a cool down. (e.g. 3 days

The pool can remain permissionless and safe.

SamSteinGG (Vader) disputed:

This is an invalid finding as creating pools is not a permissionless operation, the token must be in the supported list of assets.

alcueca (judge) commented:

I can’t see a check for a token to be in a supported list of assets.

SamSteinGG (Vader) commented:

@alcueca There seems to be some confusion. The submitted of the bounty links the Vader Pool Factory of DEX V1 and the Pool of DEX V2 which are not interacting between them. As such, the finding is invalid.

The original report as published on Code4rena, by jonah1005. 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 creation is permissionless and the initial price is set solely by the first liquidity provider without any restrictions or minimum liquidity requirements.

Impact

The attacker can mint a large amount of synthetic asset at a very low cost, and the pool cannot be revoked, making the legitimate pool invalid and allowing the attacker to drain liquidity.

What the attacker needed

None

The fix

The protocol should restrict minting synthetic assets from new and illiquid pools by requiring a minimum liquidity (e.g., 1M Vader) and a cooldown period (e.g., 3 days) before synthetic assets can be deployed.

How it was found

  1. Attacker creates a pool for a new token.
  2. Attacker sets the price extremely cheap by depositing 1 wei of the token and 10^18 wei Vader.
  3. Attacker mints a large amount of synthetic asset by providing another 10^18 wei Vader.

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.

A synthetic asset is a token that mirrors the price of another asset. The pool's price is set by the first person to add liquidity, and anyone can create a pool. So an attacker can create a pool for a new token at a very low price, then mint a lot of the synthetic asset cheaply, which breaks the system for that token.

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 jonah1005

View all

39 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.