The battle outcome determination uses timestamp::now_seconds()
as a source of randomness, which creates predictable and manipulatable outcomes. This allows attackers to calculate battle results in advance and potentially force specific outcomes by timing their transactions.
The battle resolution logic relies on the current timestamp modulo total skill to determine winners, making the "random" selection cryptographically insecure and vulnerable to manipulation.
Likelihood:
Validators and sophisticated users can predict battle outcomes by analyzing the current timestamp
Attackers can monitor the mempool and time transactions to force specific outcomes
The timestamp-based RNG is deterministic and can be calculated in advance
Impact:
Economic exploitation of the battle betting system
Loss of fairness in battle outcomes
Users lose trust in the protocol's randomness guarantees
This PoC demonstrates how attackers can predict and manipulate battle outcomes:
The mitigation replaces timestamp-based RNG with cryptographically secure randomness:
This mitigation uses Aptos' cryptographically secure randomness module, making battle outcomes unpredictable and preventing timestamp-based manipulation attacks.
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.