Owner can set the feeRate to be greater than 100% and cause all future calls to exercise to revert
The owner can set the fee rate to a value greater than 100%, causing the subtraction in the exercise function to underflow and revert. This prevents buyers from exercising their options, allowing the owner to collect premiums without risk.
Submitted by IllIllI, also found by 0xDjango, ACai, antonttc, BowTiedWardens, Cityscape, defsec, dipp, FSchmoede, GimelSec, gzeon, hickuphh3, hubble, joestakey, Kenshin, m9800, MiloTruck, RagePit, Ruhum, shenwilly, TomFrenchBlockchain, and WatchPug
Impact
The owner can force options to be non-exercisable, collecting premium without risking the loss of their NFT/tokens
Proof of Concept
After a buyer buys an option owned by the owner, the owner can change the fee rate to be close to type(uint256).max, which will cause the subtraction below to always underflow, preventing the exercise of the option. Once the option expires, the owner can change the fee back and wait for another buyer
File: contracts/src/Cally.sol #1
288 // increment vault beneficiary's ETH balance
289 ethBalance[getVaultBeneficiary(vaultId)] += msg.value - fee;
Recommended Mitigation Steps
Add reasonable fee rate bounds checks in the setFee() function
outdoteth (Cally) confirmed and resolved:
this issue is fixed here; https://github.com/outdoteth/cally/pull/7
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 setFee function lacks an upper bound check, allowing the owner to set a fee rate that causes an underflow in the exercise calculation.
Impact
The owner can force options to be non-exercisable, collecting premium without risking the loss of their NFT/tokens.
What the attacker needed
Owner controls fee rate; buyer purchases an option
The fix
The issue was fixed by adding reasonable fee rate bounds checks in the setFee() function.
How it was found
- A buyer buys an option owned by the owner.
- The owner changes the fee rate to a very high value (close to type(uint256).max).
- The buyer attempts to exercise the option, but the transaction reverts due to underflow.
- After the option expires, the owner can change the fee back and wait for another buyer.
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.
In this smart contract, the owner can set a fee that is so high that when a buyer tries to exercise their option, the calculation underflows (goes below zero) and the transaction fails. This means the buyer cannot exercise, but the owner keeps the premium paid.
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.