Description
Weak cryptographic random number used to choose the reward can allow a malicious validator to ensure they win a high value reward.
Impact
Rewards can be manipulated by validators.
Proof of Concept
The following function can be used to generate a timestamp which corresponds to a desirable random number value which is used when choosing a reward. For example, the following timestamp corresponds to the number 98 when used in the random number generation, this results in a reward of 0.5 ether. This technique and the exact value is used in two submissions that demonstrate re-entracy attacks against MysteryBox::claimSingleReward and MysteryBox::claimAllRewards.
Reentrancy vulnerability in MysteryBox::claimSingleReward allows an attacker to steal funds.
Reentrancy vulnerability in MysteryBox::claimAllRewards allows an attacker to steal funds.
Recommended mitigation
Use a purpose built, trusted and well tested library for random number generation.
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.