The PizzaDrop contract uses predictable timestamp-based pseudo-randomness for reward generation instead of cryptographically secure randomness. The get_random_slice()
function on line 90-92 generates reward amounts using timestamp::now_microseconds() % 401 + 100
, making all rewards completely deterministic and exploitable.
Since blockchain timestamps are publicly visible and predictable, attackers can calculate optimal transaction timing to guarantee maximum rewards (500 Octas) while legitimate users receive suboptimal amounts based on random registration timing.
Likelihood:
Every user registration automatically triggers this predictable generation mechanism
Every user registration automatically triggers this predictable generation mechanism
Sophisticated attackers can time transactions to microsecond precision using MEV techniques
No additional conditions or privileges required for exploitation
Impact:
Unfair reward distribution heavily favoring attackers who optimize transaction timing
Legitimate users systematically receive suboptimal rewards due to random timing
Complete breakdown of airdrop fairness guarantees and randomness assumptions
Potential for coordinated attacks to drain maximum value from the reward pool
Reputational damage to protocol due to manipulated reward distribution
Live blockchain testing demonstrates complete predictability of the randomness mechanism:
An attacker monitoring blockchain state can calculate that registering when timestamp % 401 = 300
guarantees the maximum reward of 400 + 100 = 500 Octas, while other users receive random amounts based purely on timing luck.
Implement cryptographically secure randomness or combine multiple unpredictable entropy sources to prevent timing-based manipulation of reward amounts.
The `get_random_slice` function should only be called by the owner via the `register_pizza_lover` function. Also, the `owner` is trusted and will not choose a specific time for a new user to register. Therefore, I disagree with the claim of most reports in this group that an attacker can manipulate the random number of pizza slices. But I agree with the root cause of the reports in this group, that the random distribution is not completely random.
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.