-
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
Malicious user can permanently DOS logic to claimAuction
, preventing refunds/payment of fees
#1467
Labels
3 (High Risk)
Assets can be stolen/lost/compromised directly
bug
Something isn't working
duplicate-734
satisfactory
satisfies C4 submission criteria; eligible for awards
Comments
c4-submissions
added
3 (High Risk)
Assets can be stolen/lost/compromised directly
bug
Something isn't working
labels
Nov 13, 2023
141345 marked the issue as duplicate of #1632 |
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 |
c4-judge
added
duplicate-1782
duplicate-734
satisfactory
satisfies C4 submission criteria; eligible for awards
and removed
duplicate-1782
labels
Dec 1, 2023
alex-ppg marked the issue as satisfactory |
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-734
satisfactory
satisfies C4 submission criteria; eligible for awards
Lines of code
https://github.com/code-423n4/2023-10-nextgen/blob/main/smart-contracts/AuctionDemo.sol#L104-L120
Vulnerability details
Impact
Due to the use of low-level calls in the
AuctionDemo:claimAuction
, an attacker can fill an auction with a bunch of stink bids, and force any call toclaimAuction
to run out of gas by wasting the maximum amount of gas in calls to addresses they own. This will prevent actual auctioneers from receiving their refunds, prevent the auction winner from receiving the NFT, and prevent the admin from receiving fees.Proof of Concept
Consider how the
claimAuction
function is implemented. Here I have stripped most of the extraneous details & just kept the logic which is done for refunds, which occurs in theelse if
block:Effectively this function will loop over all auction entries which are not cancelled and send the refund back to the creator of that entry. This ultimately allows an attacker to perform the following attack:
receive payable
function which runs an ~inf loop when triggeredWhen the auction winner calls
claimAuction
, this will attempt to pay refunds to all the auctioneers who did not win, which include all the stink bids created by this attacker. On each attempt, the external call to the malicious smart contract will burn the maximum amount of gas possible. Eventually, after attempting to refund a few of these stink bids, this function call will run out of gas, resulting in permanent DOS.Tools Used
Manual review
Recommended Mitigation Steps
Refunds should be implemented in such a way that users call a separate function to receive their refund, rather than this logic happening in the
claimAuction
function.Assessed type
DoS
The text was updated successfully, but these errors were encountered: