Normal behavior:
Each registered user should receive a random slice size in the advertised range (100–500), where “random” means unpredictable to users and not steerable by timing.
Issue:
The assigned slice is computed as 100 + (timestamp::now_microseconds() % 401)
, which is fully deterministic from the current time. An attacker can time or spam registrations to bias toward high values (near 500). When combined with easy address creation (and especially with H1 if not fixed), this enables systematic payout maximization and accelerates pool depletion.
Likelihood:
The output depends solely on local time; attackers can control when they call registration to hit favorable residues modulo 401 (e.g., target 500 by choosing now % 401 == 400
).
There is no rate limit, commit-reveal, or other entropy source to resist timing/spam strategies.
Even with owner-only registration, the owner (or colluding parties) can still time registrations, breaking fairness.
Impact:
Payout gaming / fairness breach: Attackers (or favored parties) systematically harvest higher amounts than honest users by timing calls.
Accelerated pool depletion: In combination with mass address creation (Sybil behavior), average payout per claimed address increases → the pool drains faster.
Forward escalation: If the advertised 100–500 refers to APT (as per spec) and amounts are later scaled to APT (×1e8), this predictability becomes a high-severity financial issue.
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.