Skip to content
Business logic Audit finding Intermediate

Change in auctionMultiplier/auctionDecrement change profitability of auctions and factory can steal all tokens from a basket abusing it

The factory owner can change auction parameters (auctionMultiplier and auctionDecrement) without any protection, which alters the profitability of bonded auctions. By setting auctionMultiplier to zero and auctionDecrement to its maximum, the factory owner can make settleAuction withdraw all tokens from a basket for free.

0x0x0x Follow

Originally disclosed on Code4rena

Submitted by 0x0x0x

When factory changes auctionMultiplier or auctionDecrement profitability of bonded auctions change. There is no protection against this behaviour. Furthermore, factory owners can decide to get all tokens from baskets where they are bonded for the auction.

Proof of concept

1- Factory owners call bondForRebalance for an auction.

2- Factory owners sets auctionMultiplier as 0 and auctionDecrement as maximum value

3- settleAuction is called. newRatio = 0, since a = b = 0. All tokens can be withdrawn with this call, since tokensNeeded = 0.

Extra notes

Furthermore, even the factory owners does not try to scam users. In case auctionMultiplier or auctionDecrement is changed, all current auctionBonder from Auctions can only call settleAuction with different constraints. Because of different constraints, users/bonder will lose/gain funds.

Mitigation step

Save auctionDecrement and auctionMultiplier to global variables in Auction.sol, when startAuction is called.

frank-beard (Kuiper) confirmed and commented:

Adding in protection from the global governance is definitely important.

0xleastwood (judge) decreased severity to Medium and commented:

The warden has identified an issue whereby the factory owner can rug-pull baskets through the re-balancing mechanism. Because newRatio = 0, the basket improperly checks the tokens needed in the contract. However, this assumes that the factory owner is malicious which satisfies medium severity due to assets not being at direct risk.

The sponsor has decided to add additional protections (potentially via timelock) to mitigate this issue.

This rug-pull is made even more difficult by the fact that newRatio must be >= minIbRatio. Because minIbRatio is behind timelock, I think this rug vector is unlikely or at least can only be used to steal a fixed amount of funds.


The original report as published on Code4rena, by 0x0x0x. 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 auction parameters are read from the factory at settlement time rather than being fixed when the auction starts, so the factory owner can manipulate them to make the settlement require zero tokens.

Impact

The factory owner could steal all tokens from a basket, but the judge notes that newRatio must be >= minIbRatio (behind timelock), making the rug vector unlikely or limited to a fixed amount.

What the attacker needed

Factory owner is malicious; newRatio >= minIbRatio (behind timelock)

The fix

The auction parameters should be saved to global variables in Auction.sol when startAuction is called, and additional protections (potentially via timelock) should be added.

How it was found

  1. Factory owners call bondForRebalance for an auction.
  2. Factory owners set auctionMultiplier to 0 and auctionDecrement to maximum value.
  3. settleAuction is called, resulting in newRatio = 0 and tokensNeeded = 0, allowing all tokens to be withdrawn.

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 smart contract lets a factory owner adjust settings that control how auctions work. If the owner sets those settings to extreme values, they can take all the tokens from a basket without paying. This is like a referee changing the rules mid-game to win.

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 0x0x0x

View all

6 more disclosed reports, best first.

More from Kuiper 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.