A vulnerability in the BoostController
contract results in incorrect boost calculations due to improper handling of voting power and total weight values. This flaw can be exploited to gain an unfair advantage in reward distribution, leading to potential financial loss and protocol imbalance.
Issue:
The function updateTotalWeight()
is used to get the total weight but does not properly update values for the specific pool and user before performing the boost calculation.
This means that stale data can be used, causing incorrect multipliers.
The function BoostCalculator.calculateTimeWeightedBoost()
relies on totalWeight
and totalVotingPower
, but these values might be outdated.
If totalVotingPower
is zero (e.g., during early staking), the calculation may incorrectly default to the base amount, missing the intended boost effect.
The function attempts to cap the boosted amount, but it incorrectly compares boostedAmount
with the maxBoostAmount
, which is calculated based on the base amount, possibly leading to incorrect rewards.
The function fetches totalSupply
of veToken
, and if this is zero, it may cause unintended behavior.
PoC:
Deploy the contract with a mock veToken
contract.
Add a test pool.
Set up user staking in veToken
.
Call _calculateBoost()
with different values to observe incorrect calculations.
Output:
The output shows that the boost calculation does not correctly apply the multiplier, leading to an ineffective or unfair allocation of rewards.
Users may not receive the correct boost multiplier, leading to reduced rewards.
Attackers can manipulate the system to gain an unfair advantage.
Pools may not distribute rewards correctly, causing financial loss to legitimate participants.
A user could repeatedly call the function at optimal moments to maximize their rewards unfairly.
Manual review.
Ensure that updateTotalWeight()
correctly updates the voting power and weight before usage.
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.