The normal behavior is that the module assigns a random pizza slice amount to each registered user for an airdrop, using the current timestamp's microseconds to generate the randomness. The amount is meant to be unpredictable and fairly distributed between 100 and 500 APT.
The specific issue is that the randomness source is solely based on the timestamp (timestamp::now_microseconds()
), which is deterministic and manipulable. An attacker can manipulate transaction timing to predict or control the amount assigned, compromising fairness and security.
Likelihood:
Anytime a user or attacker can trigger the registration function during variable block/timestamp intervals, they can predict or influence the assigned amount.
In blockchains or environments where miners/validators can manipulate timestamps, the attacker can maximize their airdrop reward.
Impact:
Users with malicious intent can consistently receive higher allocations, leading to unfair distribution.
The airdrop fund may be disproportionately drained by attackers, damaging trust and causing financial loss.
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.