The placeBid() function is designed to enforce fair auction bidding by requiring each new bid to exceed the previous bid by a minimum percentage increment defined as S_MIN_BID_INCREMENT_PERCENTAGE (5%). When a previous bid exists, the function calculates the minimum required bid amount to ensure meaningful bid increases and prevent spam bidding. This calculation is intended to compute: previousBidAmount * 1.05 (a 5% increase), which should be implemented as (previousBidAmount * 105) / 100 to maintain precision.
The placeBid() function contains a mathematical precision vulnerability in the bid increment calculation at line 152-153. The function calculates requiredAmount = (previousBidAmount / 100) * (100 + S_MIN_BID_INCREMENT_PERCENTAGE), which performs division before multiplication. This violates Solidity best practices and causes precision loss due to integer truncation. When previousBidAmount is not perfectly divisible by 100, the division truncates the remainder, resulting in a lower requiredAmount than intended. This allows attackers to place bids that are lower than the intended 5% increment, systematically underbidding throughout an auction and winning NFTs for less than fair market value.
Likelihood:
The vulnerability is triggered on every single bid placement where a previous bid exists, making exploitation extremely frequent and unavoidable. Any bidder can exploit this vulnerability without special permissions or complex setup by simply placing bids with amounts designed to maximize truncation. Attackers can use tools to calculate optimal bid amounts that exploit the maximum precision loss, and the vulnerability compounds over multiple bidding rounds.
The mathematical error is deterministic and always produces the same underbid opportunity for any given previous bid amount. Since NFT auctions typically involve multiple sequential bids, an attacker can exploit this repeatedly throughout an auction's lifecycle. The vulnerability affects all active auctions simultaneously, creating widespread impact.
Impact:
The precision loss enables several forms of auction manipulation:
Systematic Underbidding: Attackers can win auctions by bidding less than the intended 5% increment, reducing competition and acquisition costs
Seller Revenue Loss: Cumulative precision loss over multiple bids reduces the final sale price, disadvantaging sellers
Unfair Competitive Advantage: Sophisticated attackers who understand the vulnerability gain an edge over honest bidders
Trust Erosion: Users discovering they could have won auctions with lower bids lose confidence in the platform
The PoC demonstrates concrete impact:
On a bid of 1 ether + 99 wei, attackers save 103 wei per bid
Over 5 bidding rounds, cumulative loss reaches 123 wei
With larger bid amounts and more rounds, the impact scales proportionally
While individual losses are small (typically under 200 wei per bid), the cumulative effect across thousands of auctions and multiple bidding rounds creates significant value extraction from the protocol and its users.
Reorder the arithmetic operation to multiply before dividing, preventing precision loss:
Integer division in requiredAmount truncates fractions, allowing bids slightly lower than intended.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.