The randomness on get_random_slice
is derived from timestamp::now_microseconds()
which is not random. Malicious user can use this value to manipulate the amount that can be received on the drop and when the one that controls the owner is not truthful, the address that registered can be manipulated to get the highest amount possible (500 APT).
Likelihood:
Only the owner can execute the function, but there can be bias for the results. A malicious user may bias the result by picking the transaction submission time.
A malicious validator can bias the result easily by selecting which block the get_random_slice
transaction goes to.
Impact:
Unfairness on the drop, as there is a possibility that every address is malicious.
Loss of funds.
Use randomness API provided by the aptos_framework
.
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.