Skip to content
Race condition Audit finding Intermediate

mintSynth() and burnSynth() can be front run

The mintSynth() and burnSynth() functions issue or redeem synthetic assets based on pool reserves, so each call moves the price, yet they accept no slippage limit. An attacker could front-run a large mint or burn to trade against the resulting price change and take value from the user.

WatchPug Follow

Originally disclosed on Code4rena

Submitted by WatchPug

Given that mintSynth() and burnSynth() will issue and redeem assets based on the price of the pool (reserves), and they will create price impact based on the volume being minted and burnt.

However, the current implementation provides no parameter for slippage control, making them vulnerable to front-run attacks. Especially for transactions with rather large volumes.

Recommendation

Consider adding a minAmountOut parameter.

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 mint and burn functions compute amounts from live pool reserves without letting the caller specify a minimum output, so the transaction can be sandwiched.

Impact

Large mint or burn transactions could be front-run and sandwiched, causing the user to receive a worse amount than expected.

What the attacker needed

Attacker can see pending transactions; victim mints or burns a large volume

The fix

The functions should be fixed by adding a minimum-output parameter so callers can bound slippage.

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 sets prices from how much of each token it holds. When someone mints or burns a large amount, that price shifts. Because the function lets the user set no minimum acceptable result, someone watching the pending transaction can trade just before it and profit from the shift, leaving the user with a worse deal.

What is Race condition?

Parallel requests reach a state the code assumed could not happen: a coupon used twice, a limit overrun, a check skipped.

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.

Race conditions

The lesson behind this report.

Parallel requests reach a state the code assumed could not happen: a coupon used twice, a limit overrun, a check skipped.