Mystery Box

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

Potential reentrancy attack

Summary

A potential reentrancy attack in (src/MysteryBox.sol#86)

Vulnerability Details

(src/MysteryBox.sol#86)

(bool success,) = payable(msg.sender).call{value: totalValue}("");
require(success, "Transfer failed");
delete rewardsOwned[msg.sender];

Impact

This makes it possible for bad actors to uncover the identity of the mystery boxes by purchasing one ticket, open a box to check for rewards, withdraw them from the contract and repeat the process

Tools Used

Slither

Recommendations

reset the totalValue = zero before `delete rewardsOwned[msg.sender]`

Updates

Appeal created

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.

Give us feedback!