licenseFee can be greater than BASE
The license fee could be set higher than the BASE value, causing an underflow in the handleFees function and making it revert. This would prevent any function that calls handleFees from working, wasting gas and potentially burning bonds.
Submitted by itsmeSTYJ
Impact
Worst case - no functions that contains handleFees() can pass because line 118 will always underflow and revert. You only need feePct to be bigger than BASE for the handleFees() function to fail which will result in a lot of gas wasted and potentially bond burnt.
I did not classify this as high risk because a simple fix would be to simply reduce the licenseFee via changeLicenseFee.
Recommended Mitigation Steps
Add these require statement to the following functions:
-
Basket.changeLicenseFee()
require(newLicenseFee <= BASE, "changeLicenseFee: license fee cannot be greater than 100%");
-
Factory.proposeBasketLicense()
require(licenseFee <= BASE, "proposeBasketLicense: license fee cannot be greater than 100%");
frank-beard (Kuiper) acknowledged
Alex the Entreprenerd (judge) commented:
Agree with the finding, the warden highlighted an admin exploit that allows to DOS the basket. Adding a check not only prevents the exploit, but gives a security guarantee to the protocol users
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
Likely, the contract lacks a check to ensure the license fee does not exceed BASE, allowing an admin to set an invalid value that causes an underflow.
What the attacker needed
Admin privileges to set license fee
The fix
Add require statements to Basket.changeLicenseFee() and Factory.proposeBasketLicense() to ensure the license fee does not exceed BASE.
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 has a fee that must not exceed 100%. If someone sets it above 100%, a calculation underflows (goes below zero) and the function crashes. This stops other functions from working, wasting gas and possibly losing funds.
What is DoS?
A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.