The addReward function in the MysteryBox contract does not validate the input parameters, which could lead to unexpected behavior or potential exploitation.
The addReward function allows the contract owner to add rewards to the reward pool. However, there is no validation on the input parameters, such as the reward name and value. This could lead to issues such as adding rewards with zero value or empty names, which might disrupt the reward distribution logic.
The vulnerable code is likely in the addReward function:
Test Case Demonstrating Vulnerability:
Adding rewards with invalid parameters could disrupt the reward distribution logic.
Malicious actors could add rewards with misleading or harmful parameters.
Manual code review
Add validation checks for the input parameters in the addReward function.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.