Missing cap on LicenseFee
Submitted by gzeon, also found by 0x0x0x and TomFrenchBlockchain
There is no cap on LicenseFee. While change of LicenseFee is under 1 day timelock, introducing a
maxLicenseFee can improve credibility by removing the “rug” vector. There is a minLicenseFee in the contracts, while imo make little sense to have minLicenseFee but not maxLicenseFee.
An incorrectly set LicenseFee can potentially lead to over/underflow in Basket.sol#L140-141 which is used in most of the function.
Proof of Concept
Basket.sol#L177 Factory.sol#L77 Basket.sol#L49
Recommended Mitigation Steps
Define a maxLicenseFee
frank-beard (Kuiper) acknowledged, but disagreed with High severity and commented:
Generally it is intended for the publishers to act correctly and the timelock is intended to prevent incorrect values from making it all the way through, however there is validity in reducing how the fee can be modified, such as reducing how much any one fee change can change the fee. I would consider this a low risk issue.
0xleastwood (judge) decreased severity to Medium and commented:
It seems like changes to
licenseFeecould potentially brick the contract ashandleFees()underflows, preventing users from minting/burning tokens. I’d deem this asmediumseverity due to compromised protocol availability.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
What is known
A medium-severity smart contracts bug in Kuiper contest. Code4rena made it public on 2 May 2022. Found in the 2021-12-defiprotocol audit contest (finding M-01).
About Smart contracts
Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
What is Smart contracts?
Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.