Missing sane bounds on asset weights
The contract's update function for asset weights lacks bounds checks, allowing an owner to set extreme values. This could cause the booster to mint excessive or insufficient reward tokens.
Submitted by IllIllI
The admin may fat-finger a change, or be malicious, and have the weights be extreme - ranging from zero to type(uint256).max, which would cause the booster to pay out unexpected amounts
Proof of Concept
No bounds checks in the update function:
File: contracts/VeTokenMinter.sol \#1
41 function updateveAssetWeight(address veAssetOperator, uint256 newWeight) external onlyOwner {
42 require(operators.contains(veAssetOperator), "not an veAsset operator");
43 totalWeight -= veAssetWeights[veAssetOperator];
44 veAssetWeights[veAssetOperator] = newWeight;
45 totalWeight += newWeight;
46 }
The value is used by the reward contract to determine how much to mint:
File: contracts/Booster.sol \#2
598 function rewardClaimed(
599 uint256 _pid,
600 address _address,
601 uint256 _amount
602 ) external returns (bool) {
603 address rewardContract = poolInfo[_pid].veAssetRewards;
604 require(msg.sender == rewardContract || msg.sender == lockRewards, "!auth");
605 ITokenMinter veTokenMinter = ITokenMinter(minter);
606 //calc the amount of veAssetEarned
607 uint256 _veAssetEarned = _amount.mul(veTokenMinter.veAssetWeights(address(this))).div(
608 veTokenMinter.totalWeight()
609 );
610 //mint reward tokens
611 ITokenMinter(minter).mint(_address, _veAssetEarned);
Wrong values will lead to excessive inflation/deflation.
Recommended Mitigation Steps
Have sane upper/lower limits on the values.
solvetony (veToken Finance) confirmed, but disagreed with severity and commented:
We may consider adding this.
Alex the Entreprenerd (judge) commented:
The warden has shown how due to a lack of checks certain assets may provide a disproportionate amount of rewards.
Because this is contingent on an admin mistake, and the impact would be loss or gain of Yield; I believe Medium Severity to be appropriate.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Impact
Wrong weight values could lead to excessive inflation or deflation of rewards, but this requires an admin mistake or malicious action.
What the attacker needed
Admin sets extreme weight
The fix
The contract should enforce sane upper and lower limits on the weight values.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A smart contract lets an admin set how much reward each asset earns. Without limits, a typo or malicious admin could set a huge or tiny number, making the system pay out too much or too little.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.