Platform: Code4rena
Start Date: 10/05/2022
Pot Size: $50,000 USDC
Total HM: 13
Participants: 100
Period: 5 days
Judge: HardlyDifficult
Total Solo HM: 1
Id: 122
League: ETH
Rank: 100/100
Findings: 1
Award: $8.17
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: IllIllI
Also found by: 0x52, 0xf15ers, 0xsanson, Bludya, BondiPestControl, Czar102, GimelSec, Kumpa, _Adam, berndartmueller, catchup, crispymangoes, eccentricexit, ellahi, hake, horsefacts, pedroais, peritoflores, reassor, shenwilly, shung, smiling_heretic, sseefried, throttle
8.1655 USDC - $8.17
setFee has no require statement enforcing a maximum. This means that if the owner were to act malicous, or if the owners private key were compromised, they'd be able to set the fee to 100% whenever they wanted to. This issue is magnified because of the nature of how options work. Since the owner can see when options are expiring, and whether they are in the money or not, they can have a pretty good idea about when someone would try to exercise an option.
Imagine the following scenario:
-Marry creates a vault with her BAYC
-Alice buys Marry's call option.
-Some time passes.
-Bob(the owner) sees that Alice is holding an option for a BAYC, that is currently in the money with only 1 day left till expiration.
-Bob knows it is very likely that Alice will exercise the option soon, so he calls setFee
and raises the fee from 1% -> 100%.
-Alice exercises the option sending 125 ETH with her call to exercise
.
-Alice gets Marry's NFT, but Marry does not get any of the sale ETH, instead Bob has taken all of it.
-Bob calls withdrawProtocolFees
and claims the 125 ETH.
-None
-Add a reasonable max fee require statement like this
function setFee(uint256 feeRate_) external onlyOwner { require( feeRate_ <= MAX_FEE, "feeRate_ too big"); feeRate = feeRate_; }
-This would still allow the owner to change the fee from 1% -> 5% (or whatever the max fee is set to), but atleast vault creators now know that at most the owner can only take whatever the max fee is.
#0 - outdoteth
2022-05-15T19:29:08Z
owner can change fee at any time; https://github.com/code-423n4/2022-05-cally-findings/issues/47 owner can set fee greater than 100%: https://github.com/code-423n4/2022-05-cally-findings/issues/48