Skip to content
Business logic Audit finding Advanced

Redemption value of synths can be manipulated to drain VaderPoolV2 of all native assets in the associated pair

The redemption value of synths could be manipulated by flashloan-driven changes to the pool's reserves, allowing an attacker to mint synths cheaply and burn them for profit, draining native assets from VaderPoolV2.

TomFrenchBlockchain Follow

Originally disclosed on Code4rena

Submitted by TomFrenchBlockchain, also found by certora

Draining of funds from VaderPoolV2.

Proof of Concept

See the VaderPool.mintSynth function: https://github.com/code-423n4/2021-12-vader/blob/fd2787013608438beae361ce1bb6d9ffba466c45/contracts/dex-v2/pool/VaderPoolV2.sol#L153-L194

As the pool’s reserves can be manipulated through flashloans similar to on UniswapV2 (the slip mechanism can be mitigated by splitting the manipulation over a number of trades), an attacker may set the exchange rate between nativeAsset and synths (calculated from the reserves). An attacker can exploit this to drain funds from the pool.

  1. The attacker first flashloans and sells a huge amount of foreignAsset to the pool. The pool now thinks nativeAsset is extremely valuable.
  2. The attacker now uses a relatively small amount of nativeAsset to mint synths using VaderPool.mintSynth. As the pool thinks nativeAsset is very valuable the attacker will receive a huge amount of synths.
  3. The attacker can now manipulate the pool in the opposite direction by buying up the foreignAsset they sold to the pool. nativeAsset is now back at its normal price, or perhaps artificially low if the attacker wishes.
  4. The attacker now burns all of their synths. As nativeAsset is considered much less valuable than at the point the synths were minted it takes a lot more of nativeAsset in order to pay out for the burned synths.

For the price of a flashloan and some swap fees, the attacker has now managed to extract a large amount of nativeAsset from the pool. This process can be repeated as long as it is profitable.

Recommended Mitigation Steps

Tie the exchange rate use for minting/burning synths to a manipulation resistant oracle.

SamSteinGG (Vader) acknowledged


The original report as published on Code4rena, by TomFrenchBlockchain. 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 exchange rate for minting and burning synths is derived directly from the pool's reserves, which can be manipulated within a single transaction using flashloans.

Impact

The attacker could drain a large amount of nativeAsset from the pool, and the process can be repeated as long as it is profitable.

What the attacker needed

Access to flashloan capital; ability to trade in the pool

The fix

The exchange rate used for minting and burning synths should be tied to a manipulation-resistant oracle.

How it was found

  1. The attacker flashloans a huge amount of foreignAsset and sells it to the pool, making nativeAsset appear extremely valuable.
  2. The attacker uses a small amount of nativeAsset to mint synths via VaderPool.mintSynth, receiving a huge amount of synths due to the inflated nativeAsset value.
  3. The attacker buys back the foreignAsset they sold, restoring or even lowering the nativeAsset price.
  4. The attacker burns all their synths, receiving a large amount of nativeAsset because it is now considered less valuable.

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 pool holds two types of tokens and sets their exchange rate based on how much of each it holds. An attacker can temporarily flood the pool with one token to distort the rate, mint a large amount of a synthetic token at the distorted rate, then reverse the distortion and burn the synthetic tokens for a profit. This lets them steal the pool's valuable tokens.

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 TomFrenchBlockchain

View all

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