A vulnerability exists in the removeBoostDelegation function of the BoostController contract, where the poolBoost.workingSupply is not properly checked when reducing delegation amounts. When the workingSupply is lower than the delegation amount being removed, the function fails to account for this state, leading to an inflated boost in the pool. This allows an attacker to repeatedly delegate and remove boosts, artificially increasing the total boost of the pool. This manipulation results in improper reward distribution, leading to unfair advantages and economic imbalances.
Affected function: https://github.com/Cyfrin/2025-02-raac/blob/89ccb062e2b175374d40d824263a4c0b601bcb7f/contracts/core/governance/boost/BoostController.sol#L242
If the (poolBoost.totalBoost < delegation.amount), there is a problem in accounting. How can this state be reached?
This is how it occurs:
Delegation Creation:
A user delegates their veRAAC tokens to another recipient (receiver).
This increases the totalBoost and workingSupply of the pool.
Pool Boost Updates:
The receiver updates their boost in the pool, locking in the delegated boost values.
New User Joins the Pool:
A legitimate user deposits their veRAAC tokens and updates their boost.
Rewards are calculated based on the current totalBoost.
Delegation Expires & Removal Begins:
The delegation expiry time passes.
The recipient calls removeBoostDelegation.
The function reduces totalBoost and workingSupply, but only when values are greater than the delegation amount.
when workingSupply < delegation.amount, it does not properly handle the state, leaving totalBoost inflated.
Economic Impact on Reward Distribution:
Due to totalBoost remaining artificially high, the reward calculations for legitimate users become skewed.
Users receive fewer rewards than they should, benefiting the attacker.
Proof of code:
Add this code to your testfile and run:
Vulnerability flow.
Initial State Creation:
Second Delegation:
Delegation Removals:
Final Corrupted State:
Reward Dilution:
Legitimate users receive fewer rewards
Inflated boosts permanently reduce reward share
Each exploitation increases dilution
Compounding Effect:
Multiple removals can stack inflated boosts
Each removal can add to pool inflation
No upper bound on potential inflation
State Corruption:
Pool totals become permanently inflated
No mechanism to correct corrupted state
Affects all future protocol operations
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.