The get_random_slice
function uses timestamp-based pseudorandomness instead of the recommended Aptos randomness API. While practical exploitation is limited due to consensus-driven timestamps and trusted owner controls, this function is by definition not random as claimed in the README
The implementation uses timestamp::now_microseconds() % 401
for randomness generation instead of the cryptographically secure aptos_framework::randomness
API, despite having the correct #[randomness]
attribute.
Likelihood: Low - Requires sophisticated timing analysis and malicious trusted owner
Impact: Medium - Affects distribution fairness in airdrop scenario
Medium severity because:
Deviates from Aptos secure alternatives
While timestamps are consensus-driven (not manipulable by single validator), they remain predictable
Owner is typically trusted, reducing likelihood of malicious exploitation
Limited scope to airdrop distribution rather than core protocol security
Demonstrates the predictable nature of timestamp-based randomness:
First add this setup helper to the pizza_drop.move
file
Then run the test
Use the proper Aptos randomness API to align with security best practices:
This provides cryptographically secure randomness that follows Aptos framework recommendations and eliminates deterministic reward distribution.
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.