Mystery Box

First Flight #25
Beginner FriendlyFoundry
100 EXP
View results
Submission Details
Severity: high
Valid

Reentrancy Attack on Claim Single Reward

Summary

The claimSingleReward function is also vulnerable to a reentrancy attack, similar to the claimAllRewards function.

Vulnerability Details

The claimSingleReward function sends Ether to the caller before updating the state, allowing for potential reentrancy:

Impact

High. An attacker could repeatedly claim the same reward, draining more Ether than they should receive.

Tools Used

Manual code review

Recommendations

Implement the checks-effects-interactions pattern:

  • First, store the value and delete the reward

  • Then, transfer the Ether

Consider using OpenZeppelin's ReentrancyGuard contract to add a nonReentrant modifier to sensitive functions.

Updates

Lead Judging Commences

inallhonesty Lead Judge
about 1 year ago

Appeal created

inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

`claimSingleReward` reentrancy

Support

FAQs

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

Give us feedback!