The _cancelAllBids function has a vulnerability, as it does not verify whether the user at this time is the highest bidder
Summary
The _cancelAllBids function has a vulnerability, as it does not verify whether the user at this time is the highest bidder.
Vulnerability Detail
Suppose there is the following scenario:
Alice participates in bidding for a token. In the final round of bidding, Alice is the highest bidder and she is about to win the auction.
At the end of the auction, Alice preemptively calls the cancelAllBidsAndWithdrawCollateral function to withdraw all her collateral from the _withdrawCollateral function. Alice then calls the closeAuction function to withdraw the auction token. These calls are executed within a single transaction, allowing Alice to win the auction successfully and free of charge.
Impact
The user with the highest bid can win the auction for free by using the cancelAllBidsAndWithdrawCollateral function
neon2835
high
The _cancelAllBids function has a vulnerability, as it does not verify whether the user at this time is the highest bidder
Summary
The
_cancelAllBids
function has a vulnerability, as it does not verify whether the user at this time is the highest bidder.Vulnerability Detail
Suppose there is the following scenario:
Alice participates in bidding for a token. In the final round of bidding, Alice is the highest bidder and she is about to win the auction.
At the end of the auction, Alice preemptively calls the
cancelAllBidsAndWithdrawCollateral
function to withdraw all her collateral from the_withdrawCollateral
function. Alice then calls thecloseAuction
function to withdraw the auction token. These calls are executed within a single transaction, allowing Alice to win the auction successfully and free of charge.Impact
The user with the highest bid can win the auction for free by using the
cancelAllBidsAndWithdrawCollateral
functionCode Snippet
https://github.com/sherlock-audit/2024-02-radicalxchange/blob/main/pco-art/contracts/auction/EnglishPeriodicAuctionInternal.sol#L416-L434
Tool used
Manual Review
Recommendation
Optimize the _cancelAllBids function
Duplicate of #14