Mystery Box

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

Reentrancy in MysteryBox::claimAllRewards

Summary

CEI is not followed in claimAllRewards so a reentrancy is possible if a user gets a reward that isn't coal.

Vulnerability Details

Reentrancy can be used to drain all funds.

Impact

High

Tools Used

Foundry

Recommendations

delete RewardsOwned[msg.sender]
should be done before:
(bool success,) = payable(msg.sender).call{value: totalValue}("");

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!