The battle system is supposed to use a random number to fairly decide the winner based on each Rapper's skill level.
The contract uses the block's timestamp, which is a public and predictable number, to determine the winner. This allows any user to calculate the result of a battle before it happens, removing any element of chance.
Likelihood:
This can be exploited in every battle by anyone who can read the current time of the blockchain.
Impact:
Guaranteed Wins/Losses: Attackers can see the outcome of a battle in advance and will only choose to participate in battles they are guaranteed to win. This breaks the core game mechanic.
Theft of Funds: Malicious players can consistently drain CRED
tokens from honest players by only entering favorable battles, leading to direct financial loss for others.
Loss of Trust: Once players realize the game is rigged, they will no longer trust or use the protocol.
An attacker can easily predict the winner.
An attacker sees a defender waiting in the arena.
They calculate both Rappers' skill scores (defender_skill
, challenger_skill
).
They read the current block timestamp and perform the same calculation the contract does: rnd = timestamp % total_skill
.
If the calculation shows they will win (rnd >= defender_skill
), they join the battle. If not, they wait for the next block and try again.
This can be demonstrated with a simple function:
Replace the insecure timestamp with the secure randomness provided by the Aptos framework. This ensures the outcome is unpredictable.
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.
The contest is complete and the rewards are being distributed.