The BoostController
contract is designed to manage boost calculations and delegations for a protocol using a Curve-style boost mechanism. However, a critical vulnerability exists in the _calculateBoost
function, which allows users with no veToken balance to update their boost value. This flaw can be exploited by malicious actors to artificially inflate the poolBoost.totalBoost
by repeatedly calling updateUserBoost
with multiple accounts. This undermines the fairness and integrity of the protocol, as the boost mechanism is no longer tied to actual veToken holdings.
The vulnerability lies in the _calculateBoost
function, which is called by updateUserBoost
to calculate the boost value for a user. Specifically, the function returns the amount
directly if the user has no veToken balance (userBalance == 0
):
Exploit Scenario
Malicious User Creates Accounts:
An attacker creates multiple accounts, each with no veToken balance.
Call updateUserBoost
:
Each account calls updateUserBoost
with a pool address.
Since these accounts have no veToken balance, _calculateBoost
returns the amount
(e.g., 10000
).
Inflate poolBoost.totalBoost
:
The poolBoost.totalBoost
is updated with this amount
, even though the accounts have no veToken.
By repeating this process, the attacker can artificially inflate poolBoost.totalBoost
to an arbitrarily high value.
add the following test case into BoostController.test.js
run npx hardhat test --grep "user with 0 veToken"
We can see that even though the accounts have no veToken, the poolBoost.totalBoost
is updated with the amount
three times(10000*3).
Pool Manipulation:
The inflated totalBoost
disrupts the fairness of the protocol, as it skews the distribution of rewards or other benefits tied to the boost mechanism.
Economic Exploitation:
Attackers could exploit this to gain an unfair advantage in the protocol, potentially draining rewards or other resources.
Protocol Integrity:
This undermines trust in the protocol, as the boost mechanism is no longer tied to actual veToken holdings.
The impact is High, the likelihood is High, so the severity is High.
Manual Review
To fix this vulnerability, the _calculateBoost
function should not return a boost value if the user has no veToken balance. Instead, it should return 0
or revert with an error. This ensures that only users with a valid veToken balance can update their boost value.
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.