Skip to content
DoS Audit finding Beginner

Factory.sol - lack of checks in setAuctionDecrement will cause reverts in Auction::settleAuction()

The setAuctionDecrement function lacks minimum and maximum checks, allowing the owner to set auctionDecrement to zero. This causes settleAuction to revert due to division by zero, blocking auctions from being settled.

Alex the Entreprenerd Follow

Originally disclosed on Code4rena

Submitted by Alex the Entreprenerd, also found by goatbug

Impact

setAuctionDecrement doesn’t check for a min nor a max amount This means we can change auctionDecrement which would allow owner to set auctionDecrement to 0

This will cause the function settleAuction in Auction.sol to revert

This allows the owner to block auctions from being settled

Proof of Concept

setAuctionDecrement(0) Now settleAuction will revert due to division by 0

Recommended Mitigation Steps

Add checks in setAuctionDecrement Refactor to

function setAuctionDecrement(uint256 newAuctionDecrement) public override onlyOwner {
    require(newAuctionDecrement > AMOUNT);
    require(newAuctionDecrement <= AMOUNT\_2);
    auctionDecrement = newAuctionDecrement;
}

frank-beard (Kuiper) acknowledged and disagreed with severity:

the owner for this is intended to be a dao that acts in support of the protocol, however this is a good point to the centralization concerns for the protocol, we will most likely manage this by adding a timelock to these function

Alex the Entreprenerd (judge) commented:

I wrote the finding and in being the contest judge will be forfeiting all winnings.

After thinking about it, this is a medium severity finding because it is a DOS that relies on a specific condition. While the argument that the owner can be being always hold up, it is important that protocol users understand the risk, so it’s important to flag up admin privileges

The original report as published on Code4rena, by Alex the Entreprenerd. 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 setAuctionDecrement function does not validate that the new decrement is within a safe range, allowing zero which leads to division by zero in settleAuction.

Impact

The owner can block auctions from being settled, causing a denial of service for protocol users.

What the attacker needed

Owner privileges

The fix

Add checks in setAuctionDecrement to ensure the new value is greater than a minimum and less than or equal to a maximum.

How it was found

  1. Call setAuctionDecrement with 0 as the new value.
  2. Attempt to call settleAuction, which will revert due to division by 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 function that sets a decrement value has no lower or upper limit. If the owner sets it to zero, another function that divides by this value will crash, stopping auctions from being settled. This is a denial-of-service issue caused by missing input validation.

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 Alex the Entreprenerd

View all

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