CvxLocker.setBoost wrong validation
The setBoost function validated existing storage variables instead of the new parameters, allowing incorrect boost values to be set. Once set, these values could not be changed, breaking core contract functionality.
Submitted by cmichel
The CvxLocker.setBoost function does not validate the _max, _rate parameters, instead it validates the already set storage variables.
// @audit this is checking the already-set storage variables, not the parameters
require(maximumBoostPayment < 1500, "over max payment"); //max 15%
require(boostRate < 30000, "over max rate"); //max 3x
Impact
Once wrong boost values are set (which are not validated when they are set), they cannot be set to new values anymore, breaking core contract functionality.
Recommended Mitigation Steps
Implement these two checks instead:
require(_max < 1500, "over max payment"); //max 15%
require(_rate < 30000, "over max rate"); //max 3x
GalloDaSballo (BadgerDAO) acknowledged:
This can be an issue as our strat takes those variables at face value
GalloDaSballo (BadgerDAO) confirmed:
As Badger we ended up upgrading the strategy to check for the validity of the inputs
C2tP-C2tP (BadgerDAO) commented:
for convex side, we can layer on an admin contract that has the correct checks
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
Root cause
The validation logic checked the current storage variables instead of the function parameters.
Impact
Once wrong boost values are set, they cannot be updated, breaking core contract functionality.
What the attacker needed
None
The fix
The checks should validate the parameters `_max` and `_rate` instead of the storage variables.
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 function that sets boost limits checked the old stored values rather than the new ones being provided. This meant someone could set invalid limits, and then the function would be stuck because it kept checking the old (now invalid) values.
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.