Skip to content
Business logic Audit finding Advanced

Synth tokens can get over-minted

The Synth token minting logic does not deduct or lock the foreign reserve when native deposits are added, allowing Synth tokens to be over-minted. An attacker could exploit this to mint unbacked Synth tokens and later redeem them for pool funds.

WatchPug Follow

Originally disclosed on Code4rena

Submitted by WatchPug

Per the document:

It also is capable of using liquidity units as collateral for synthetic assets, of which it will always have guaranteed redemption liquidity for.

However, in the current implementation, Synth tokens are minted based on the calculation result. While nativeDeposit be added to the reserve, reserveForeign will remain unchanged, not deducted nor locked.

Making it possible for Synth tokens to get over-minted.

Proof of Concept

  • The Vader pool for BTC-USDV is newly created, with nearly 0 liquidity.
  • Alice add liquidity with 100,000 USDV and 1 BTC;
  • Bob mintSynth() with 100,000 USDV, got 0.25 BTC vSynth;
  • Alice remove all the liquidity received at step 1, got all the 200k USDV and 1 BTC.

The 0.25 BTC vSynth held by Bob is now backed by nothing and unable to be redeemed.

This also makes it possible for a sophisticated attacker to steal funds from the Vader pool.

The attacker may do the following in one transaction:

  1. Add liquidity with 10 USDV and 10,000 BTC (flash loan);
  2. Call mintSynth() with 10 USDV, repeat for 10 times, got 1461 BTC vSynth;
  3. Remove liquidity and repay flash loan, keep the 1461 BTC vSynth;
  4. Wait for other users to add liquidity and when the BTC reserve is sufficient, call burnSynth() to steal USDV from the pool.

SamSteinGG (Vader) confirmed

Given that the codebase attempts to implement the Thorchain rust code in a one-to-one fashion, findings that relate to the mathematical accuracy of the codebase will only be accepted in one of the following cases:

  • The code deviates from the Thorchain implementation
  • A test case is created that illustrates the problem

While intuition is a valid ground for novel implementations, we have re-implemented a battle-tested implementation in another language and as such it is considered secure by design unless proven otherwise.

The original report as published on Code4rena, by WatchPug. 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 minting function does not update the foreign reserve balance when native tokens are deposited, so the collateral accounting is incorrect.

Impact

An attacker could over-mint Synth tokens and later redeem them to steal funds from the pool, potentially draining liquidity.

What the attacker needed

Ability to add and remove liquidity; Ability to call mintSynth and burnSynth; Flash loan for large capital (optional)

How it was found

  1. Alice adds liquidity with 100,000 USDV and 1 BTC to a newly created BTC-USDV pool.
  2. Bob calls mintSynth() with 100,000 USDV and receives 0.25 BTC vSynth.
  3. Alice removes all her liquidity, receiving back all 200k USDV and 1 BTC.
  4. Bob's 0.25 BTC vSynth is now unbacked and cannot be redeemed.

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 Synth token is a synthetic asset that should be backed by collateral in a pool. The bug is that when you deposit one asset to mint Synths, the other asset in the pool is not reduced, so you can create more Synths than the pool can actually back. This means someone could create fake Synths and later trade them for real assets, stealing from the pool.

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 WatchPug

View all

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