Canceling an auction will result in a loss of borrower funds towards initiator fees
When a borrower cancels an active auction, the initiator fee is charged on the full reserve price even though fees on the existing bid were already paid. The borrower therefore overpays initiator fees and loses funds.
Source: https://github.com/sherlock-audit/2022-10-astaria-judging/issues/198
Found by
0xRajeev
Summary
The initiator fee on the current bid has already been accounted during that bid but is expected to be paid again on cancellation by the borrower.
Vulnerability Detail
Consider an active auction with a reserve price of 10 ETH and a current bid of 9 ETH. If the auction gets canceled, the transferAmount will be 10 ETH. Once the cancellation logic adds repayment to current bidder (see other finding reported on this issue), the initiator fees for cancellation should only be calculated on the delta payment of 1 ETH because the fees for the earlier 9 ETH bid has already been paid to the initiator. However, this is not accounted and requires the borrower to pay the initiator fees on the entire reserve price leading to overpayment towards the initiator and loss of funds for the borrower.
Impact
Canceling an auction will require paying (a lot) more initiator fees than needed resulting in a loss of funds for the borrower.
Code Snippet
- https://github.com/sherlock-audit/2022-10-astaria/blob/main/lib/astaria-gpl/src/AuctionHouse.sol#L265-L268
- https://github.com/sherlock-audit/2022-10-astaria/blob/main/lib/astaria-gpl/src/AuctionHouse.sol#L220
Tool used
Manual Review
Recommendation
The cancellation amount required should be the reserve price + liquidation fee, where the fee is calculated on (reserve price - current bid) and not the reserve price.
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 cancellation logic computes the initiator fee on the full reserve price instead of only on the difference between the reserve price and the current bid.
Impact
Cancelling an auction could require the borrower to pay substantially more initiator fees than needed, causing a loss of funds.
What the attacker needed
An active auction with a current bid; borrower cancels the auction
The fix
The cancellation amount should be the reserve price plus a liquidation fee calculated on the difference between the reserve price and the current bid, not on the full reserve price.
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 lets people bid on something, and a small fee goes to whoever started the auction. If the owner cancels the auction, the code charges that fee again on the whole starting price, even though part of it was already paid on the bids received. So the owner pays more than they should and loses money.
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.