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