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

Users can break the maxPositionsPerAccount limit with offchainOrders()

Summary

fillOffchainOrders() doesn't check for maxPositionsPerAccount, the user can adds an arbitrary number of markets

Vulnerability Details

in createMarketOrder()
we will check maxPositionsPerAccount by tradingAccount.validatePositionsLimit()
but in fillOffchainOrders() we don't check it

see codes:

https://github.com/Cyfrin/2024-07-zaros/blob/d687fe96bb7ace8652778797052a38763fbcbb1b/src/perpetuals/branches/SettlementBranch.sol#L186-L316

So the user can fillOffchainOrders() add as many markets as they want, breaking the maxPositionsPerAccount security restriction

Impact

Breaks the maxPositionsPerAccount security limit.
like OOG security protection

Tools Used

Recommendations

fillOffchainOrders() also needs to check maxPositionsPerAccount.

Updates

Lead Judging Commences

inallhonesty Lead Judge 11 months ago
Submission Judgement Published
Validated
Assigned finding tags:

`maxPositionsPerAccount` may be exceeded by combining onchain and offchain orders

Support

FAQs

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