Open code423n4 opened 2 years ago
We may consider to add this
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.
Lines of code
https://github.com/code-423n4/2022-05-vetoken/blob/2d7cd1f6780a9bcc8387dea8fecfbd758462c152/contracts/VeTokenMinter.sol#L41-L46
Vulnerability details
Impact
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 amountsProof of Concept
No bounds checks in the update function:
https://github.com/code-423n4/2022-05-vetoken/blob/2d7cd1f6780a9bcc8387dea8fecfbd758462c152/contracts/VeTokenMinter.sol#L41-L46
The value is used by the reward contract to determine how much to mint:
https://github.com/code-423n4/2022-05-vetoken/blob/2d7cd1f6780a9bcc8387dea8fecfbd758462c152/contracts/Booster.sol#L598-L611
Wrong values will lead to excessive inflation/deflation
Tools Used
Code inspection
Recommended Mitigation Steps
Have sane upper/lower limits on the values