Skip to content
Business logic Audit finding Intermediate

4 Synths can be minted with fake base token

The mintSynth function fails to verify that the base token is one of the allowed base tokens, allowing an attacker to pass an arbitrary token as base. This lets them mint synths at an incorrect ratio, potentially inflating the minted amount and breaking pool accounting.

Vader Protocol contest

Originally disclosed on Code4rena

The Pools.mintSynth function does not check if base is one of the base tokens. One can transfer tokens to the pool and set base=token and call mintSynth(token, token, member).

The _actualInput = getAddedAmount(base, token); will return the token amount added but use the ratio compared to the base reserve calcSwapOutput(_actualInput=tokenInput, mapToken_baseAmount[token], mapToken_tokenAmount[token]); = tokenIn / baseAmount * tokenAmount which yields a wrong swap result.

It breaks the accounting for the pool as tokens are transferred in, but the base balance is increased.

The amount that is minted could also be inflated (cheaper than sending the actual base tokens), especially if token is a high-precision token or worth less than base.

Recommend checking that base is either USDV or VADER in mintSynth.

strictly-scarce (vader) confirmed:

Valid, funds can be lost.

strictly-scarce (vader) commented:

would bundle this issue with: https://github.com/code-423n4/2021-04-vader-findings/issues/205

The original report as published on Code4rena. 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 mintSynth function lacks validation that the base parameter is one of the accepted base tokens (USDV or VADER).

Impact

The incorrect accounting could allow an attacker to mint synths at a cheaper rate, potentially inflating the minted amount and causing loss of funds.

What the attacker needed

Ability to transfer tokens to the pool; ability to call mintSynth

How it was found

  1. Transfer some tokens to the pool.
  2. Call mintSynth with base set to the token you transferred and token set to the same token.
  3. The function calculates the input amount and swap output using the token's reserve as if it were the base reserve, yielding an incorrect mint amount.

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, users can mint synthetic assets by depositing a base token. The code forgot to check that the token you say is the base is actually one of the approved base tokens. So you could use any token, and the pool would calculate the amount of synth to mint using the wrong exchange rate, possibly giving you more synths than you should get.

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