Tadle

Tadle
DeFiFoundry
27,750 USDC
View results
Submission Details
Severity: low
Invalid

Potential Out-of-Gas Error Due to Unbounded Loop in Token Whitelist Update

Summary

Potential Out-of-Gas Error Due to Unbounded Loop in Token Whitelist Update

Vulnerability Details

The updateTokenWhiteListed function processes an array of token addresses without any upper bound check on the array length. This could potentially lead to out-of-gas errors if a very large array is passed, as the gas cost of the transaction would increase linearly with the number of tokens.

https://github.com/Cyfrin/2024-08-tadle/blob/04fd8634701697184a3f3a5558b41c109866e5f8/src/core/TokenManager.sol#L197C3-L223C6

Steps to Reproduce:

  1. Call updateTokenWhiteListed with an extremely large array of token addresses.

  2. Observe that the transaction may fail due to exceeding the block gas limit.

Impact

Potential denial of service due to transaction failures for large token lists.

Tools Used

Manual review

Recommendations

Implement a maximum length check for the input array.

Updates

Lead Judging Commences

0xnevi Lead Judge
about 1 year ago
0xnevi Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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