## Auction can be ended with large limit order
The auction contract used a sentinel value of type(int128).max to indicate cancellation, but a limit order at that price passed all checks. An attacker could place such an order at the start of the auction, causing the auction to be finalised and the trader refunded, effectively preventing the auction from taking place.
Originally disclosed on Sherlock
Source: https://github.com/sherlock-audit/2022-09-knox-judging/issues/153
Found by
ArbitraryExecution
In the function AuctionInternal._previewWithdraw, the number type(int128).max is used as a sentinel value for deciding whether the auction is canceled. However, an order for all contracts at a price of type(int128).max passes all requires checks for limit orders.
If such an order is placed at the start of the auction, the auction can be finalized and the trader will be refunded the entire amount when the auction is processed or canceled. This effectively prevents the auction from taking place.
Recommendation
Use AuctionStorage.Status instead of sentinel values for determining whether the auction is in the canceled state.
Discussion
0xCourtney
https://github.com/KnoxFinance/knox-contracts/pull/79
rcstanciu
Reply from @arbitrary-CodeBeholder
looks good
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 contract used a sentinel value (type(int128).max) to represent the cancelled state instead of a dedicated status field, allowing a valid order to collide with that sentinel.
Impact
This effectively prevents the auction from taking place.
What the attacker needed
Ability to place a limit order
The fix
Use AuctionStorage.Status instead of sentinel values for determining whether the auction is in the canceled state.
How it was found
- Place a limit order for all contracts at a price of type(int128).max at the start of the auction.
- The order passes all require checks for limit orders.
- The auction can then be finalised and the trader refunded the entire amount when processed or cancelled.
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.
An auction contract used a special maximum number to mean 'cancelled'. But a user could place a real order at that same maximum price, which the contract accepted. This let the attacker end the auction immediately and get their money back, stopping the auction from happening.
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.