The FeeCollector's reward distribution mechanism contains a flaw where malicious users can claim rewards for entire collection periods despite minimal participation. By strategically timing token locks to coincide with reward distribution snapshots, attackers gain eligibility for rewards proportional to their last-minute stake size rather than actual protocol contribution duration. This is possible because the contract calculates rewards based on the user's current voting power at the time of the reward snapshot, rather than verifying whether the user was actively contributing throughout the fee collection period.
https://github.com/Cyfrin/2025-02-raac/blob/main/contracts/core/collectors/FeeCollector.sol
problematic implementation in the _calculatePendingRewards
Alice locks 100 RAAC for 310 days at Day 0.
Bob locks 100 RAAC for 300 days at Day 10.
At Day 10, a fee distribution occurs. Both Alice and Bob have identical voting power (300 days remaining).
Result: Alice and Bob split rewards equally, despite Alice contributing to the protocol for 10 additional days.
Unfair Dilution: Legitimate users experience reduced yields as malicious users capture disproportionate shares despite minimal participation.
manual review
initialize lastClaimTime at lock time .
Implement Time-Weighted Voting Power and check if lastclaimtime is after distribution start period to prevent malicious users from claiming rewards after start of distribution .
Call _updateLastClaimTime() in the claimRewards function to update the new lastclaimTime after every claim .
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.