Skip to content
DoS Audit finding Beginner

Setting Factory.auctionDecrement to zero causes Denial of Service in Auction.settleAuction()

The owner can set the auction decrement to zero, which causes a division by zero in the auction settlement function, making it always revert. This blocks the settlement of auctions, leading to a denial of service.

pants Follow

Originally disclosed on Code4rena

Submitted by pants.

The function Factory.setAuctionDecrement() allows the owner to set the state variable Factory.auctionDecrement to zero.

Impact

If Factory.auctionDecrement equals zero then the function Auction.settleAuction() will always revert due to a division by zero:

uint256 b = (bondBlock - auctionStart) * BASE / factory.auctionDecrement();

Tool Used

Manual code review.

Recommended Mitigation Steps

Add an appropriate require statement to the function Factory.setAuctionDecrement() to disallow setting Factory.auctionDecrement to zero.

frank-beard (Kuiper) acknowledged

Alex the Entreprenerd (judge) commented:

I agree with the finding, because this shows a way to DOS the protocol, given specific conditions, I will raise the severity to medium

The original report as published on Code4rena, by pants. 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

The setter function allows setting the auction decrement to zero without validation, and the settlement function divides by this value without checking for zero.

What the attacker needed

Owner sets auctionDecrement to zero

The fix

Add a require statement in `Factory.setAuctionDecrement()` to disallow setting the value to zero.

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 has a setting that controls how much the price drops during an auction. If that setting is set to zero, a calculation that divides by it fails, so the auction can never be completed. This means auctions get stuck and cannot be settled.

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 pants

View all

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

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.