The liquidation signature used in `liquidatePartyA` lacks nonces for both parties, so it remains valid even after the parties' states change. An attacker could use a stale signature to liquidate a solvent party, causing loss of funds for partyA, partyB, and the liquidator.
The liquidation function limits partyB's loss to its current allocated balance, so if partyB has both a profitable and a losing position, liquidating the losing position first can zero out the balance and then the profitable position adds its full profit, inflating partyB's balance. This can make the protocol owe more than it holds, potentially causing a bank run.
A check meant to prevent remaining quote values below a minimum was skipped when a full close was requested, allowing a partial fill to leave a dust position. This could reduce liquidation incentives and cause losses.
The solvency check in `fillCloseRequest` requires both parties to be solvent at both the market price and the provided close price, causing the transaction to revert even when the close price would make both parties solvent. This prevents position closure and can lead to unfair liquidation and loss of funds for partyA.
The MultiAccount.depositAndAllocateForAccount function uses the same amount value for deposit and allocate, but deposit amounts use the collateral token's decimals while allocate amounts use 18 decimals. For a token like USDC with 6 decimals, this causes the allocated amount to be 1e12 times smaller than intended, leaving the user with only a dust allocation.
Allocated balances are stored as unsigned integers, so when a position's unrealised loss would make the allocated balance negative, closing that position reverts. This can prevent users from closing positions, locking their funds in the protocol.
When the protocol is paused, users cannot adjust their positions, so falling oracle prices can make positions under-collateralised. On unpause, liquidators can front-run users' attempts to add collateral or close positions and liquidate them unfairly.
A suspended PartyB can bypass the withdrawal restriction by using a separate PartyA account to create a deliberately losing position, then filling the close request to move funds out. This allows the attacker to transfer ill-gotten gains out of the protocol, causing losses to the protocol and its users.
During a multi-step liquidation, if Party A becomes solvent again after the liquidation starts, the profits from Party A's profitable positions are not credited to Party A's allocated balance, while Party B's losses are deducted. Instead, Party A's allocated balance is reset to zero, so the profits remain in the protocol.
A party could partially fill a close request after the other party had cancelled it, leaving the position value below the minimum acceptable quote value. This breaks an invariant and could make liquidation uneconomical, exposing users to greater market risk.
The liquidation contract allows a liquidator to update symbol prices multiple times during a multi-step liquidation as long as the overall unrealized profit and loss and total unrealized loss remain unchanged. A malicious liquidator colluding with a counterparty can exploit this to inflate the counterparty's payout, draining protocol funds.
The fee collector can withdraw all trading fees, leaving insufficient balance to refund fees to Party A when a quote is cancelled or expires, causing an underflow that blocks several functions. This griefs the protocol by temporarily denying service until the fee collector's balance is replenished.
The liquidation of Party B can become permanently stuck if the liquidation timeout is reached before the positions are liquidated, because the required price signature must be created within that timeout period. An attacker could exploit this by delaying liquidation until the timeout expires, causing the liquidation status to remain true and blocking further liquidations.
A rounding error in the closeQuote function can cause the locked balance to remain unchanged when a position is partially closed with a very small filledAmount. An attacker could repeatedly close tiny amounts to accumulate locked balances, reducing the available balance they can withdraw.
Hedgers can ignore users' close requests, forcing users to call forceClosePosition and pay a spread, which benefits hedgers. This results in users closing at a worse price and losing profit.
The liquidation function for PartyB accounts sets the liquidator's share to zero when the account's loss exceeds the liquidation fee, so liquidators receive no reward for performing the liquidation. This lack of incentive may cause liquidations to be delayed or skipped, exposing PartyB to additional risk.
A partyA could open a long limit position with an openedPrice of 0, causing no locked values and inflating its unrealised profit (uPnL) at no cost. This could let partyA avoid liquidation and wait for favourable price movements.
The protocol fee for LIMIT orders is calculated from the user-supplied limit price rather than the actual execution price. For short positions, a user can set a very low limit price to pay almost no fee, and for long positions, a user can set a very high limit price and unknowingly pay an inflated fee.
The two-step liquidation process for partyB allows a malicious liquidator to liquidate only selected positions, temporarily inflating partyA's unrealised profit and enabling partyA to deallocate funds that should cover losses, leaving bad debt. This can be exploited to steal funds from other parties or the protocol.
The setSymbolsPrice function only checks that the price signature timestamp is not too far in the future, but does not check that it is recent enough. An attacker could reuse an old price signature with a large negative unrealised profit and loss value to trigger a liquidation of partyB.
The trading fee for a quote is calculated using the current fee rate at the time of cancellation, not the rate when the quote was created. If the fee rate changes between creation and cancellation, the refunded fee amount will be incorrect, causing a loss to either the user or the protocol.
The deallocateForPartyB and transferAllocation functions do not check whether partyA is liquidated, allowing partyB to deallocate funds while partyA's liquidation is ongoing. An attacker controlling partyA, partyB, and liquidator could inflate partyB's allocated balance and steal all protocol funds.
The solvency check functions for closing a position fail to account for extra profit from the difference between the close price and the current price, causing transactions to revert even when the user would be solvent after closing. This prevents users from closing positions in cases where the price difference would make them solvent.
The emergencyClosePosition function only works when a position's status is OPENED, but PartyA can change the status to CLOSE_PENDING by requesting to close a tiny amount, causing emergency closes to revert. This could block PartyB from urgently closing positions during emergency mode, potentially leading to losses.
The setSymbolsPrice function only records the first liquidator who calls it, so a malicious liquidator can call it with minimal symbol prices and still receive the full liquidation fee. This leaves the liquidation incomplete and disincentivises others from finishing, potentially forcing the counterparty to complete the process at their own cost.
The insolvency check in the openPosition function is performed before the locked balance is adjusted to maintain fixed leverage, so the check may pass even though the adjusted locked value would make the account insolvent. As a result, a user could open a position and immediately become liquidatable, losing their CVA and liquidation fee.
A malicious PartyB can repeatedly partially fill a close request with a tiny amount, which updates the quote's modifyTimestamp and resets the force-close cooldown, preventing PartyA from ever force-closing the position. This allows PartyB to block unfavourable closes and cause a loss of profits for PartyA.
The liquidation of PartyB and the removal of their open positions are separate steps, so if the second step is not called, the positions remain open. Later, when PartyA is liquidated, these already-liquidated positions are still included in the profit and loss calculation, which can divert funds to the already-liquidated PartyB and cause a loss to other PartyBs.
A liquidatable party can front-run a liquidation transaction by incrementing their on-chain nonce, causing the liquidation signature to become invalid and the liquidation to revert. This allows them to block liquidation and potentially avoid losses.
SU
Symmetrical Update
High
Instant results are busy. Press Enter to search every report.
No direct matches. Search every report above, or try a bug class like IDOR or SSRF.