The liquidateAccounts
function uses an unconstrained mark price calculation that could lead to incorrect valuations during liquidations, potentially resulting in unfair liquidation amounts.
While the liquidateAccounts
function intentionally bypasses skew checks during liquidation to prevent DoS attacks, it still relies on the getMarkPrice
function which performs unconstrained price impact calculations. This creates a risk of mispriced liquidations.
The unbounded mark price flows through the following sequence:
Mark price calculation uses unconstrained skew values
This price is used to calculate position notional values
Notional values determine collateral deduction via deductAccountMargin
Final liquidation proceeds are based on these calculations
The getMarkPrice
function does not bound its price impact calculations to respect maxSkew limits, even though these values are configured in the protocol. While skew limit bypassing during liquidation is intentional for execution purposes, the lack of bounds in price calculation could lead to extreme price impacts.
Market has high skew near maxSkew limit
Large position requires liquidation
Mark price calculation uses unbounded skew values
Results in extreme price impact
Position is liquidated at incorrect value
Either liquidated user loses excess funds or protocol receives insufficient value
Since the mark price calculation uses unconstrained skew values during liquidation valuation, positions can be liquidated at prices that significantly deviate from fair market value. Large positions near or beyond skew limits could experience extreme price impacts, leading to substantial mispricing during the liquidation. This affects the notional value calculation which directly determines the liquidation proceeds, potentially causing material losses to either the liquidated user (if overvalued) or the protocol (if undervalued). While this only impacts positions being liquidated, the magnitude of potential mispricing for individual liquidations is unbounded mathematically within the code, warranting a high severity rating.
Add price impact bounds to getMarkPrice
:
This maintains the ability to execute liquidations beyond skew limits while ensuring price impacts remain bounded.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.