Severity: High
Staking reward calculations use raw * on u64 values. When the stake amount or elapsed ledgers are large, the multiplication silently wraps to a small number, allowing an attacker to claim far less (or far more) than they are owed.
- Attacker stakes a large amount and waits many ledgers.
claim_rewardscomputesstake * rate * elapsedusing unchecked arithmetic.- The product overflows
u64, wrapping to near zero — reward pool is effectively stolen or the attacker receives an inflated payout depending on wrap direction.
let reward = stake * rate * elapsed; // ❌ silent overflowlet reward = stake
.checked_mul(rate)
.and_then(|v| v.checked_mul(elapsed))
.expect("reward overflow"); // ✅See secure/secure_vault for the full corrected implementation.