The openBox function in the MysteryBox contract uses a deterministic method to generate random numbers, which can be exploited by malicious actors to predict and manipulate the outcomes of mystery box openings.
Predictable Inputs: The random number generation relies on block.timestamp and msg.sender. Both of these values can be known or influenced by miners or users.
Deterministic Output: Given the same inputs, the keccak256 function will always produce the same output. This means that if an attacker can predict or control the inputs, they can determine the outcome.
Limited Range: The modulo operation % 100 limits the output to a range of 0-99, which is appropriate for the probability distribution but doesn't mitigate the underlying predictability issue.
Miner Manipulation: Miners can influence the block.timestamp to some degree, potentially allowing them to affect the outcomes of box openings.
Front-Running Vulnerability: Attackers can observe pending transactions and front-run them with their own transactions using the same block.timestamp, potentially stealing favorable outcomes.
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.