The reward calculation mechanism uses the current veRAAC voting power of users instead of their historical voting power during the actual distribution periods. This allows attackers to claim rewards from past distributions they didn't participate in by acquiring veRAAC tokens just before claiming.
The reward distribution system incorrectly uses current veRAAC voting power to calculate historical rewards. This allows attackers to:
Back-claim rewards from periods they didn't participate in by acquiring veRAAC tokens just before claiming
Steal rewards allocated to legitimate long-term holders
The flaw originates from two key areas:
A. Faulty Reward Calculation Logic
In _calculatePendingRewards
:
Uses current voting power (getVotingPower()
) to calculate shares of historical rewards (totalDistributed
)
totalDistributed
accumulates rewards across all past distributions but uses current snapshot for calculations
B. Incorrect Reward Distribution Tracking
In _processDistributions
:
Stores rewards as a single cumulative value instead of per-period tracking
Loses historical context of rewards distribution
Exploit Scenario:
A legitimate user locks a moderate amount of veRAAC tokens before fee distribution, establishing an expected reward share based on that balance.
The system collects fees and allocates rewards based on the then-existing voting power.
An attacker, who had not locked tokens during the distribution, acquires a significant number of veRAAC tokens immediately before claiming rewards.
When the attacker calls claimRewards
, the reward calculation uses the inflated current voting power, resulting in a disproportionate reward payout.
From the POC above:
A legitimate user locks 1,000 tokens prior to fee collection.
A fee of 100 RAAC tokens is collected and distributed, with 50 RAAC tokens allocated to veRAAC holders.
The attacker then locks 10,000 tokens after distribution.
The attacker’s calculated pending reward is approximately 45.45 RAAC tokens, despite having not contributed to the fee collection process during the relevant distribution period.
Financial loss
Manual review and hardhat
Track rewards per distribution period, recording the user's voting power and total supply at each period.
Calculate rewards based on the time-weighted average of the user's stake during each period, not their current stake.
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.