GivingThanks

First Flight #28
Beginner FriendlyFoundry
100 EXP
View results
Submission Details
Severity: medium
Valid

Reentrancy attack in donate() function

Summary

Reentrancy attack can be done in donate() function of GivingThanks contract.

Vulnerability Details

The donate() function transfers Ether to an external charity address using a low-level call. This transfer is followed by state changes (minting ERC721 tokens). If the charity contract has a fallback or receive function that calls back into the donate() function, it could repeatedly execute and drain funds before the state is updated.

Impact

An attacker could potentially exploit this vulnerability to withdraw more funds than intended or disrupt the contract's functionality, leading to financial loss.

Tools Used

manual review

Recommendations

Use the ReentrancyGuard Modifier

Updates

Lead Judging Commences

n0kto Lead Judge 9 months ago
Submission Judgement Published
Validated
Assigned finding tags:

finding-donate-reentrancy-multiple-NFT-minted

Impact: High, one charity can reenter the donate function with the same ETH provided and mint several NFT. Likelyhood: Low, any malicious charity can do it but Admin is trusted and should verify the charity contract before "verifying" it.

Support

FAQs

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