-
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
DOS of auction and stuck funds because of gas griefing #601
Comments
141345 marked the issue as duplicate of #843 |
141345 marked the issue as duplicate of #486 |
alex-ppg marked the issue as not a duplicate |
alex-ppg marked the issue as duplicate of #1782 |
alex-ppg marked the issue as partial-50 |
This issue should not be labeled as partial-50. It shows the same root cause and impact as 734. Thanks! |
Hey @ZdravkoHr, thanks for your contribution! The submission was graded partially because of an "incorrect" recommendation chapter. There is no need to maintain mappings that are solely mutated when the auction ends, better alternatives exist as advised by other duplicated submissions. Additionally, the impact specifies that the "remainder" will be left in the contract which is not the case as all funds will be locked, not just some. |
Lines of code
https://github.com/code-423n4/2023-10-nextgen/blob/8b518196629faa37eae39736837b24926fd3c07c/smart-contracts/AuctionDemo.sol#L139
Vulnerability details
Impact
When an auction comes to its end, the highest bid is sent to the owner of the NFT selled and all other bids are send back to their owners. A gas griefing attack where a malicious bidder consumes all the gas available is possible. All auctions can be DOS-ed if a malicious bidder sends as little as 1 wei to the contract. Once entered, bidders cannot be removed. The bid call can be initiated by a contract that uses up all the available gas on receive(). The attacker can even bid several times to increase even further their chances of DOS of the system (because of the 63/64 rule) or just gas bomb it returning a huge amount of bytes.
Impact -> all the gas will be consumed and the transaction will revert, the NFT will not be send to the winner and the remainder of the funds will be stuck forever.
Proof of Concept
Tools Used
Foundry
Recommended Mitigation Steps
Add a mapping that tracks the balance of each bidder. When an auction ends, increase the corresponding balances. Then create a function that enables withdrawals from the contract by the authorized bidders.
Assessed type
DoS
The text was updated successfully, but these errors were encountered: