code-423n4 / 2023-10-nextgen-findings

5 stars 3 forks source link

Auction Winner Can Retrieve Bid Amount Back Along With NFT #1966

Closed c4-submissions closed 7 months ago

c4-submissions commented 7 months ago

Lines of code

https://github.com/code-423n4/2023-10-nextgen/blob/8b518196629faa37eae39736837b24926fd3c07c/smart-contracts/AuctionDemo.sol#L111-L114 https://github.com/code-423n4/2023-10-nextgen/blob/8b518196629faa37eae39736837b24926fd3c07c/smart-contracts/AuctionDemo.sol#L124-L130

Vulnerability details

Impact

Vulnerability allows the highest bidder (the auction winner) to reclaim their bid amount while also receiving the NFT.

Proof of Concept

The vulnerability stems from the timing of checks in the claimAuction and cancelBid functions and reentrancy.

Tools Used

Manual code review

Recommended Mitigation Steps

Assessed type

Reentrancy

c4-pre-sort commented 7 months ago

141345 marked the issue as duplicate of #962

c4-judge commented 7 months ago

alex-ppg marked the issue as duplicate of #1323

c4-judge commented 7 months ago

alex-ppg marked the issue as partial-50

c4-judge commented 7 months ago

alex-ppg marked the issue as full credit

c4-judge commented 7 months ago

alex-ppg marked the issue as partial-50