sherlock-audit / 2023-04-splits-judging

4 stars 1 forks source link

moneyversed - Unbounded For Loop in SwapperImpl.sol #20

Closed sherlock-admin closed 1 year ago

sherlock-admin commented 1 year ago

moneyversed

high

Unbounded For Loop in SwapperImpl.sol

Summary

In the flash function of SwapperImpl.sol, there is a potential unbounded loop vulnerability when looping through the quoteParams_ array, which could lead to high gas consumption and possible Denial of Service (DoS) attacks.

Vulnerability Detail

The flash function contains a loop that iterates through the quoteParams_ array. As the size of the array is not bounded, the loop could potentially consume a large amount of gas, making it susceptible to Denial of Service (DoS) attacks.

Impact

This vulnerability could lead to high gas consumption and DoS attacks, potentially impacting the availability and functionality of the platform.

Code Snippet

https://github.com/sherlock-audit/2023-04-splits/blob/main/splits-swapper/src/SwapperImpl.sol#L203

Tool used

Manual Review

Recommendation

Consider implementing a mechanism to limit the number of quote parameters that can be processed in a single transaction, such as batching or pagination. This will help reduce the risk of high gas consumption and DoS attacks.