The BaseGauge::getUserWeight function incorrectly calculates the user’s base weight by returning the total gauge weight from the GaugeController instead of the user’s actual contribution. As a result, the user’s weight, which is used for reward distribution or voting power, is miscalculated. This means that any user can 'earn' reward tokens without staking or holding any veRAAC
tokens
Vulnerability location:
BaseGauge::_getBaseWeight which is called by the BaseGauge::getUserWeight function
This is a high-impact issue because any user can simply call the BaseGauge::getReward and 'get' free reward tokens. Here is a PoC that proves it.
In the PoC above, we've two actors
user1: a user who has staked tokens and is holding veRaacTokens
nonRaacholder: a user who hasn't staked any tokens and is not holding any veRaacTokens
Yet both users earns reward tokens when the gauge receives reward tokens.
Manual review
The user's base weight in the gauge should be reflected by the number of tokens the user has staked and probably some other parameters. Here is one recommendation that fixes the problem, but the final solution can be protocol-specific and protocol owners can decide if they want to add some custom logic here
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.