Skip to content
DoS Audit finding Intermediate

AuctionLoanLiquidator#placeBid can be DoS

The placeBid function allows bids to increase by only 5% from a very low starting price, so an attacker can make tiny incremental bids and lock the auction for a period, preventing others from participating. This could let the attacker win the NFT at a low price.

zhaojie Follow with bin2chen

Originally disclosed on Code4rena

Submitted by zhaojie, also found by bin2chen

The attacker performs a DoS attack on the Bid function, causing other users to be unable to participate and eventually obtaining the NFT at a low price.

Proof of Concept

The placeBid function requires each bid to increase by 5% from the original, locking in for a period of time after each bid.

function placeBid(address _nftAddress, uint256 _tokenId, Auction memory _auction, uint256 _bid)
        external
        nonReentrant
        returns (Auction memory)
    {
        _placeBidChecks(_nftAddress, _tokenId, _auction, _bid);

        uint256 currentHighestBid = _auction.highestBid;
        // MIN_INCREMENT_BPS = 10000, _BPS = 500 , add 5%
        if (_bid == 0 || (currentHighestBid.mulDivDown(_BPS + MIN_INCREMENT_BPS, _BPS) >= _bid)) {
            revert MinBidError(_bid);
        }

        uint256 currentTime = block.timestamp;
        uint96 expiration = _auction.startTime + _auction.duration;
@>      uint96 withMargin = _auction.lastBidTime + _MIN_NO_ACTION_MARGIN;
        uint96 max = withMargin > expiration ? withMargin : expiration;
        if (max < currentTime && currentHighestBid > 0) {
            revert AuctionOverError(max);
        }
        .....
    }

The problem here is that if the initial price increases from a very small value, the second increase in percentage only needs to be a very small amount. For example: 100 wei -> 105 wei -> 110 wei.

So an attacker can start with a small bid and keep growing slowly. Because of the time lock, other users cannot participate for a period of time. Normal users must wait until the time lock is over and the transaction needs to be executed before the attacker.

If normal users are unable to participate in the bidding, the attacker can obtain the auction item (NFT) at a very low price.

Tools Used

VScode

Recommended Mitigation Steps

function placeBid(.....){
+       require (_bid > MIN_BID);
}

Assessed type

DoS

0xA5DF (judge) commented:

Given that auction duration is 3 days front-running every single tx in that timeframe isn’t going to be easy for the attacker. Considering Medium.

0xend (Gondi) confirmed and commented:

We have a check that for an auction to be settled it also requires the last bid to be at least 10’ old (to avoid someone sniping at the very end). Given this, someone doing this attack, would actually have to continue going for an indiscriminate amount of time since honest players would be able to bid and extend it.

I think this is Low/Medium.

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

The attack seems very unlikely, but given that the impact can be quite high, I’m sustaining Medium severity.

0xend (Gondi) commented:

https://github.com/pixeldaogg/florida-contracts/pull/377

Starting with a min based on principle to make sure it’s meaningful.

Gondi mitigated:

There’s a min bid now. This + the min improvement invalidates DoS.

Status: Mitigation confirmed. Full details in reports from oakcobalt and minhquanym.


The original report as published on Code4rena, by zhaojie. 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 minimum bid increment is calculated as a percentage of the current highest bid, so a very low initial bid makes subsequent required increments tiny, allowing an attacker to lock the auction with minimal cost.

Impact

The attacker could obtain the NFT at a low price, but the judge noted the attack is very unlikely given the 3-day auction duration and the requirement that the last bid be at least 10 minutes old.

What the attacker needed

Auction with low starting price; attacker can place bids; attacker can front-run or bid frequently

The fix

A minimum bid amount was added, which together with the minimum improvement invalidates the DoS.

How it was found

  1. Attacker places a very small initial bid.
  2. Attacker continues to place bids that are only slightly higher (5% increments) to keep the auction locked.
  3. Other users are unable to bid during the lock period.
  4. Attacker eventually obtains the NFT at a low price.

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 an auction, each new bid must be at least 5% higher than the last. If the starting price is very small, 5% is also very small, so someone can keep bidding just a little more and lock the auction for a while. Other people cannot bid during that lock, so the attacker might win the item cheaply.

What is DoS?

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.

More by zhaojie

View all

9 more disclosed reports, best first.

More from Gondi Invitational

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.