TempleGold

TempleDAO
Foundry
25,000 USDC
View results
Submission Details
Severity: high
Invalid

Reentrancy Vulnerability in bid Function

Summary

The bid function in the DaiGoldAuction contract is vulnerable to a reentrancy attack. This is because the function makes an external call to transfer tokens via safeTransferFrom before updating the state variables depositors and totalBidTokenAmount. If the recipient of the safeTransferFrom call is a malicious contract, it can re-enter the bid function and manipulate the state before it is properly updated.

Impact

A malicious contract could exploit this vulnerability to repeatedly call the bid function within a single transaction, thereby increasing its deposited amount without actually transferring the corresponding tokens. This could lead to the attacker unfairly winning the auction or disrupting the auction process, leading to potential financial losses and disruption of the auction's intended functionality.

Tools Used

Manual review

Recommendations

The bid function should be updated to use the nonReentrant modifier from OpenZeppelin’s ReentrancyGuard to prevent this reentrancy vulnerability and ensure state updates occur before external calls.

Updates

Lead Judging Commences

inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Lack of quality

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.