Each front-run, causes subsequent bids on the same block to fail, regardless of the user's bid amount, because the first one changes the hash : _auctions[_nftAddress][_tokenId] = _auction.hash();, resulting in the other users not being able to pass the hash check
Lines of code
https://github.com/code-423n4/2024-04-gondi/blob/b9863d73c08fcdd2337dc80a8b5e0917e18b036c/src/lib/AuctionLoanLiquidator.sol#L230
Vulnerability details
Vulnerability details
Users who need to bid can do so with the method:
AuctionLoanLiquidator.placeBid()
There are two important checks
_auction
is legal or not)bid
is > 5% overhighestBid
( bid > highestBid * 10500 / 10000)These two conditions can be easily underbid by a user Users just need to monitor
mempool
, front-runplaceBid()
starting from bid=1. Example:block = 1 , front-run
placeBid(_auction, bid=1)
--> pass ( 1 > (0 * 10500 / 10000))block = 2 , front-run
placeBid(_auction, bid=2)
--> pass ( 2 > (1 * 10500 / 10000))block = 3 , front-run
placeBid(_auction, bid=3)
--> pass ( 3 > (2 * 10500 / 10000)) ...Each front-run, causes subsequent bids on the same
block
to fail, regardless of the user's bid amount, because the first one changes thehash
:_auctions[_nftAddress][_tokenId] = _auction.hash();
, resulting in the other users not being able to pass thehash
checkImpact
Malicious front-run low bidding
Recommended Mitigation
Suggestions:
Auction
is saved instorage
placeBid()
pass inauction id
Assessed type
DoS