The addLevel function allows new levels to be added after deployment, but there is no accompanying function to set the boostPricesPerBlock for these newly added levels. As a result, users can benefit from boost features without paying any fee in VTHO tokens, bypassing the intended waiting period and staking directly on the validator for free.
Vulnerability Details
A new feature introduced in this version allows users to perform boosting, where they pay a token fee to bypass the maturity period and stake immediately to start earning rewards. Under normal operation, levels and their corresponding boost prices are set during initialization inside initializeV3 as follows:
As shown above, boostPricePerBlock is never initialized for newly added levels. Consequently, any user can call the boost or stakeAndDelegate functions on levels created via the addLevel function without paying any fee. This allows them to bypass the intended maturity period and immediately stake VET on the validator.
Impact Details
The vulnerability lets users bypass the boost fee entirely, granting them free boosts. Although no protocol funds are lost because fees are burned, the fee mechanism becomes ineffective.
Proof of Concept
Unit test demonstrating the issue (Boost.test.ts)
Add the following unit test case to the file Boost.test.ts and run with command npx hardhat test.
Note: Also import time (and optionally mine) from @nomicfoundation/hardhat-network-helpers.