Auction parameters can be changed during ongoing auction
The auction contract allows the owner to change auction parameters such as duration, reserve price, time buffer, and minimum bid increment at any time, including during an ongoing auction, and the changes take effect immediately. This can cause bidders' transactions to fail or alter their expectations, potentially leading to unintended outcomes like instant settlement or price changes.
Originally disclosed on Code4rena
Submitted by 141345, also found by pauliax, rbserver, rvierdiiev, and sorrynotsorry
The auction parameters can be changed anytime, even during ongoing auctions, and take effect immediately. Users may need time to react to the changes. The impacts maybe followings:
- some sudden changes may cause bidder’s transaction fail, such as
setReservePrice()andsetMinimumBidIncrement() - some changes may change users expectation about the auction, such as
setDuration()andsetTimeBuffer(), with different time parameters, bidders will use different strategy
Proof of Concept
src/auction/Auction.sol
function setDuration(uint256 _duration) external onlyOwner {
settings.duration = SafeCast.toUint40(_duration);
emit DurationUpdated(_duration);
}
function setReservePrice(uint256 _reservePrice) external onlyOwner {
settings.reservePrice = _reservePrice;
emit ReservePriceUpdated(_reservePrice);
}
function setTimeBuffer(uint256 _timeBuffer) external onlyOwner {
settings.timeBuffer = SafeCast.toUint40(_timeBuffer);
emit TimeBufferUpdated(_timeBuffer);
}
function setMinimumBidIncrement(uint256 _percentage) external onlyOwner {
settings.minBidIncrement = SafeCast.toUint8(_percentage);
emit MinBidIncrementPercentageUpdated(_percentage);
}
Recommended Mitigation Steps
- Do not apply changed parameters on ongoing auctions
- Add a timelock for the changes
Alex the Entreprenerd (judge) commented:
The Warden has shown how settings can be changed mid-auction, this can create undefined behaviour (insta-settlement, change of price).
While max loss is one token or the inability to settle the auction, because this could create a “social accident”, I believe that Medium Severity is appropriate.
Changes should either be cached in the Auction Parameters, or should be applied to the next auction to avoid any unexpected surprise
kulkarohan (Nouns Builder) confirmed
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
Impact
Bidders' transactions may fail or their expectations may be altered, potentially causing a 'social accident' such as instant settlement or unexpected price changes, though the maximum loss is one token or the inability to settle the auction.
What the attacker needed
Owner privileges; ongoing auction
The fix
The changes should either be cached in the auction parameters or applied only to the next auction, and a timelock could be added.
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, the rules like how long it lasts or the minimum price should stay the same until it ends. Here, the person in charge can change those rules in the middle of the auction, which can confuse bidders or make their bids fail. This is a problem because people expect the rules to be stable once the auction starts.
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.