Strike Price Not Validated Against Strike Percent, Leading to Exploitation Risk
Summary
The strikePrice and strikePercent are important parameters in the Borrowing::depositTokens function, which are passed to the BorrowLib::deposit function for option fee calculations. As the strikePercent increases, from 5% to 25%, the option fees decrease, while the potential for greater gains on strikePrice increases. A lower strikePercent, such as 5%, has a higher probability of generating returns due to the higher likelihood of ETH moving by 5%.
However, there is no validation to ensure that the strikePrice is logically consistent with the strikePercent. Malicious actors could exploit this by selecting a high strikePercent (e.g., 25%), thus paying lower option fees, and simultaneously selecting a low strikePrice (e.g., 5%), allowing them to benefit from the lower strike price associated with a smaller strikePercent. This mismatch can result in financial losses for the protocol.
Root Cause
The issue arises from the lack of a validation check to ensure that the strikePrice aligns with the chosen strikePercent.
External pre-conditions
The value of the collateral asset must increase by at least given 5% from its deposit value by the time of withdrawal.
Attack Path
- Exploiting the missing validation, an attacker selects arbitrary values for
strikePercentandstrikePrice, even if they are not logically consistent. - The attacker deposits tokens with a high
strikePercent(e.g., 25%) and selects a lowstrikePrice(e.g., 5% higher than the deposited amount), resulting in low option fees but benefiting from the higher gains that should correspond to a lowerstrikePercent. - This combination of a high
strikePercentand lowstrikePriceallows the attacker to benefit from the returns typically associated with a lowerstrikePercent, causing an unfair advantage and financial losses for the protocol.
The strike price gains are calculated during withdrawal.
Impact
The absence of proper checks allows users to input inconsistent strikePercent and strikePrice values. This leads to reduced option fees while securing gains that should be restricted to lower strikePercent values, causing financial losses to the protocol. It also negatively impacts the calculation of upsideToDeduct, leading to a lower deduction than intended.
Mitigation
To prevent exploitation, ensure that the strikePercent and strikePrice are validated against each other at the time of deposit. The following check can be applied: