Closed code423n4 closed 2 years ago
Agree that this is a major issue, but since no funds are at risk I think Med might be more appropriate.
0xean marked the issue as duplicate
0xean marked the issue as satisfactory
0xean changed the severity to 2 (Med Risk)
Lines of code
https://github.com/code-423n4/2022-11-size/blob/706a77e585d0852eae6ba0dca73dc73eb37f8fb6/src/SizeSealed.sol#L269
Vulnerability details
Impact
After the auction was created, bidders can place a bid with the custom
quoteAmount
and encryptedbaseAmount
.When the seller tries to finalize the auction, it doesn't check if the bidder's
baseAmount
is greater than zero so that the finalization can be revert with the division by zero.There is no direct fund loss but I submit as a high risk because all auctions can't be finalized by a malicious bidder.
Proof of Concept
When the seller tries to finalize the auction, it will revert here if a malicious bidder placed a bid with 0
baseAmount
.This is the test to show the scenario.
This is the test result.
Tools Used
Foundry
Recommended Mitigation Steps
We should skip the bidder when the
baseAmount == 0
here.