Beginner FriendlyFoundry
100 EXP
View results
Submission Details
Severity: high
Invalid

Arbitrary ETH send in ``withdraw`` function

Summary

The withdraw function in ThePredicter contract allows sending ETH to an arbitrary address (the caller) without sufficient checks.

Vulnerability Details

In the withdraw function:

function withdraw() public {
// ...
if (reward > 0) {
scoreBoard.clearPredictionsCount(msg.sender);
(bool success, ) = msg.sender.call{value: reward}("");
require(success, "Failed to withdraw");
}
}

The function sends ETH to msg.sender without verifying if the caller is still an approved player.

Impact

While there are checks for eligibility and reward calculation, a player who was approved but later removed (like for another match) could still withdraw funds.

Tools Used

Manual code review

Recommendations

Add an additional check to ensure the caller is still an approved player:

require(playersStatus[msg.sender] == Status.Approved, "Not approved");
Updates

Lead Judging Commences

NightHawK Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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