DeFiFoundry
60,000 USDC
View results
Submission Details
Severity: low
Valid

Accounts which are liquidatable can still trade using offchain orders

Summary

Accounts which are liquidatable can still trade using offchain orders.

Vulnerability Details

For onchain orders, OrderBranch::simulateTrade has a check:

// prevent liquidatable accounts from trading
if (TradingAccount.isLiquidatable(ctx.previousRequiredMaintenanceMarginUsdX18, marginBalanceUsdX18)) { // @audit-check marginBalance is unaltered before trade and after trade
revert Errors.AccountIsLiquidatable(tradingAccountId);
}

From the comment, we can get conclusion that accounts eligible for liquidation are prohibited from trading.
However for offchain orders, there is no such check which means accounts which are liquidatable can still trade using offchain orders.

Impact

Accounts which are liquidatable can still trade using offchain orders.

Tools Used

manual

Recommendations

Add isLiquidatable check for account in _fillOrder function like OrderBranch::simulateTrade function.

Updates

Lead Judging Commences

inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

`isLiquidatable` check missing in `_fillOrder()`

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.

Give us feedback!