Skip to content
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 in ‘ claimAuction() ’ function if an address maliciously reverts while receiving refund. #1924

Closed
c4-submissions opened this issue Nov 13, 2023 · 7 comments
Labels
3 (High Risk) Assets can be stolen/lost/compromised directly bug Something isn't working duplicate-1785 edited-by-warden unsatisfactory does not satisfy C4 submission criteria; not eligible for awards

Comments

@c4-submissions
Copy link
Contributor

c4-submissions commented Nov 13, 2023

Lines of code

https://github.com/code-423n4/2023-10-nextgen/blob/main/smart-contracts/AuctionDemo.sol#L104-L120

Vulnerability details

Impact

A malicious address can place a trivial bid and perform a DoS attack by reverting while receiving the refund.

Proof of Concept

Adam = Attacker

Adam places a trivial bid of 69 wei at the start of the auction from a contract that is designed to
revert when receiving ether.

receive() external payable {
        
        revert("Reverting: I'm malicious ");
}

When the auction eventually ends and the claimAuction() function is called by either the winner or Admin,
The refunds and NFT transfer dont happen as expected.

Because Adam's contract reverts upon receiving the refund
thus creating a Denial of Service for all bidders involved.

This can be averted by preferring 'pull over push' pattern for withdrawals / refunds.

Tools Used

Manual Review, Foundry.

Recommended Mitigation Steps

Enforce 'pull over push' design pattern for withdrawals / refunds,
as it is more secure and flexible.
It allows users or external contracts to withdraw funds on their own initiative.
This way a DoS attack could be prevented.

Assessed type

DoS

@c4-submissions c4-submissions added 3 (High Risk) Assets can be stolen/lost/compromised directly bug Something isn't working labels Nov 13, 2023
c4-submissions added a commit that referenced this issue Nov 13, 2023
@c4-pre-sort
Copy link

141345 marked the issue as duplicate of #1632

@c4-pre-sort
Copy link

141345 marked the issue as duplicate of #843

@c4-pre-sort
Copy link

141345 marked the issue as duplicate of #486

@c4-judge c4-judge reopened this Dec 1, 2023
@c4-judge
Copy link

c4-judge commented Dec 1, 2023

alex-ppg marked the issue as not a duplicate

@c4-judge c4-judge closed this as completed Dec 1, 2023
@c4-judge
Copy link

c4-judge commented Dec 1, 2023

alex-ppg marked the issue as duplicate of #2006

@c4-judge c4-judge added duplicate-2006 duplicate-1785 unsatisfactory does not satisfy C4 submission criteria; not eligible for awards and removed duplicate-2006 labels Dec 1, 2023
@c4-judge
Copy link

c4-judge commented Dec 5, 2023

alex-ppg marked the issue as unsatisfactory:
Out of scope

1 similar comment
@c4-judge
Copy link

c4-judge commented Dec 8, 2023

alex-ppg marked the issue as unsatisfactory:
Out of scope

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-1785 edited-by-warden unsatisfactory does not satisfy C4 submission criteria; not eligible for awards
Projects
None yet
Development

No branches or pull requests

4 participants