Mystery Box

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

Reentrancy Attack: Claim All Rewards

Summary

The claimAllRewards function is vulnerable to a reentrancy attack, allowing an attacker to drain more funds than they are entitled to.

Vulnerability Details

The claimAllRewards function sends Ether to the caller before updating the state. This allows the attacker to call the function again before their rewards are cleared, potentially draining the contract of more Ether than intended.

Impact

High. An attacker could potentially drain all the Ether from the contract, far exceeding their legitimate rewards.

Tools Used

Manual code review.

Recommendations

Implement the checks-effects-interactions pattern:

  • First, calculate the total value

  • Then, delete the rewards

  • Finally, transfer the Ether

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:

`claimAllRewards` reentrancy

Support

FAQs

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

Give us feedback!