Beginner FriendlyFoundryNFT
100 EXP
View results
Submission Details
Severity: high
Valid

Vulnerability To Reentrancy Attack In Refund() Method

Summary

The refund() method of the contract refunds users by accepting a player index as input, and then refunding the user the entrance fee.

Vulnerability Details

The method will refund a user first, and then disable refunding afterwards. This leaves the contract vulnerable to a reentrancy attack. If a user invokes this method repeatedly, without allowing it to finish, the user will be able to drain the contract of all of its funds.

Impact

All of the funds held by the contract.

Tools Used

Solidity

Recommendations

Reformat the refund method so that a users' ability to refund is disabled before refunding the user. Use openzeppelins reentrancy guard protection.

Updates

Lead Judging Commences

Hamiltonite Lead Judge almost 2 years ago
Submission Judgement Published
Validated
Assigned finding tags:

reentrancy-in-refund

reentrancy in refund() function

Support

FAQs

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