Mystery Box

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

Inconsistent input validations

Summary

In several functions (e.g., addReward), there is no check on the input values, which could lead to potential errors or unintended behavior

Vulnerability Details

When adding a reward, there is no validation of the _value or _name.

Impact

This could lead to potential errors or unintended behavior (e.g., unintentionally adding rewards with zero value).

Tools Used

Manual review.

Recommendations

Add input validation for critical inputs, for example:

function addReward(string memory _name, uint256 _value) public onlyOwner {
require(bytes(_name).length > 0, "Invalid name");
require(_value >= 0, "Invalid reward value");
rewardPool.push(Reward(_name, _value));
}
Updates

Appeal created

inallhonesty 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.

Give us feedback!