DeFiFoundry
60,000 USDC
View results
Submission Details
Severity: medium
Invalid

Unchecked Iteration in checkLiquidatableAccounts in the LiquidationBranch.sol

Relevant GitHub Links

https://github.com/Cyfrin/2024-07-zaros/blob/main/src/perpetuals/branches/LiquidationBranch.sol#L42-L86

Summary

The unchecked iteration in checkLiquidatableAccounts can cause transactions to revert due to gas limits being exceeded when processing a large number of accounts.

Vulnerability Details

The function checkLiquidatableAccounts iterates over a potentially large range of accounts, from lowerBound to upperBound, without any mechanism to ensure it stays within the gas limits. This can lead to situations where the function runs out of gas, causing the transaction to revert and potentially leading to denial of service.

Impact

Gas Limit Exceeded: Transactions can revert if the iteration exceeds the gas limit.

Denial of Service: Legitimate operations might be delayed or prevented due to reverted transactions.

Tools Used

Manual

Recommendations

Implement Iteration Limits: Break the task into smaller chunks to ensure the gas limit is not exceeded.

Optimize Iteration Logic: Use more efficient data structures or algorithms to minimize gas usage during iteration.

Updates

Lead Judging Commences

inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Design choice

Support

FAQs

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