-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Auctions can be manipulated #1583
Labels
3 (High Risk)
Assets can be stolen/lost/compromised directly
bug
Something isn't working
duplicate-1323
partial-50
Incomplete articulation of vulnerability; eligible for partial credit only (50%)
Comments
141345 marked the issue as duplicate of #962 |
alex-ppg marked the issue as not a duplicate |
alex-ppg marked the issue as duplicate of #1784 |
alex-ppg marked the issue as duplicate of #1323 |
alex-ppg marked the issue as partial-50 |
alex-ppg marked the issue as satisfactory |
alex-ppg marked the issue as partial-50 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
3 (High Risk)
Assets can be stolen/lost/compromised directly
bug
Something isn't working
duplicate-1323
partial-50
Incomplete articulation of vulnerability; eligible for partial credit only (50%)
Lines of code
https://github.com/code-423n4/2023-10-nextgen/blob/8b518196629faa37eae39736837b24926fd3c07c/smart-contracts/AuctionDemo.sol#L57-L61
https://github.com/code-423n4/2023-10-nextgen/blob/8b518196629faa37eae39736837b24926fd3c07c/smart-contracts/AuctionDemo.sol#L104-L120
https://github.com/code-423n4/2023-10-nextgen/blob/8b518196629faa37eae39736837b24926fd3c07c/smart-contracts/AuctionDemo.sol#L124-L130
Vulnerability details
Impact
This vulnerability enables malicious actors to unfairly manipulate an auction and winning them with a minimal bid of 1 wei.
Vulnerability Details
When ending auction via
claimAuction
, there is a check to ensure that the auction has ended, using the inclusive inequality operator>=
:On the other hand, both the
participateToAuction
andcancelBid
functions also have a check to ensure that the auction hasn't ended using an inclusive operator<=
:Due to this combination of checks, a potential vulnerability arises. An attacker could take advantage of a specific scenario: At the beginning of the auction, the malicious party places an extremely high bid, preventing others from bidding. When the auction is about to end, during the same block where the
auctionEndTime
falls, the malicious party atomically cancels their bid, place a minimal bid of 1 wei, and settling the auction, winning the NFT.Proof of Concept
Recommended Mitigation Steps
Implement a strict inequality check in the
claimAuction
function. Additionally, introduce a penalty mechanism for canceling bids, such as extending the auction duration by a predefined period (e.g., ten minutes), if bids are made during the final moments of the auction, to deter tactics involving last-minute bid cancellations and minimal rebidding.Assessed type
Timing
The text was updated successfully, but these errors were encountered: