Normal Behavior: When the owner registers users via register_pizza_lover, each user should receive a truly unpredictable random amount between 100-500 APT, ensuring fair distribution where every user has equal probability of receiving any amount in this range.
Issue: The get_random_slice function uses timestamp::now_microseconds() % 401 for randomness, which is completely predictable. Since only the owner can call register_pizza_lover (assuming the first bug is fixed), the owner can strategically time their registration calls to ensure favored users receive maximum amounts while others get minimum amounts.
Likelihood:
Owner controls exactly when register_pizza_lover is called for each user
Block timestamps are predictable using blockchain explorers
Mathematical formula (timestamp % 401) makes calculation straightforward
Owner can batch register users at calculated optimal timestamps
Impact:
Complete violation of "random" distribution promise
400 APT difference between minimum (100) and maximum (500) amounts
Systematic favoritism destroys airdrop fairness
Protocol reputation damage when manipulation patterns become visible on-chain
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.