Due to reaching a gas limit, the transaction of the PassThroughWalletImpl#passThroughToken() will be reverted
Summary
The transaction will be reverted due to reaching a gas limit in the for-loop within the PassThroughWalletImpl#passThroughToken() if too many number of tokens would be assigned into the tokens_ array parameter by a caller when the PassThroughWalletImpl#passThroughToken() would be called.
Vulnerability Detail
When a user send some funds (tokens_) to the $passThrough address, the PassThroughWalletImpl#passThroughToken() would be called.
However, there is no limitation that how many number of tokens a caller can be assigned into the tokens_ array parameter.
This lead to reaching a gas limit and therefore this transaction will be reverted in the for-loop if a user assign too many number of tokens into the tokens_ array parameter.
Impact
The transaction will be reverted due to reaching a gas limit in the for-loop within the PassThroughWalletImpl#passThroughToken().
Consider setting a limitation that how many number of tokens a caller can be assigned into the tokens_ array parameter when the PassThroughWalletImpl#passThroughToken() would be called.
0xmuxyz
medium
Due to reaching a gas limit, the transaction of the PassThroughWalletImpl#
passThroughToken()
will be revertedSummary
The transaction will be reverted due to reaching a gas limit in the for-loop within the PassThroughWalletImpl#
passThroughToken()
if too many number of tokens would be assigned into thetokens_
array parameter by a caller when the PassThroughWalletImpl#passThroughToken()
would be called.Vulnerability Detail
When a user send some funds (
tokens_
) to the$passThrough
address, the PassThroughWalletImpl#passThroughToken()
would be called.Within the PassThroughWalletImpl#
passThroughToken()
, multiple tokens can be assigned via thetokens_
array parameter and then each token would be transferred into the_passThrough
by using for-loop like this: https://github.com/sherlock-audit/2023-04-splits/blob/main/splits-pass-through-wallet/src/PassThroughWalletImpl.sol#L120 https://github.com/sherlock-audit/2023-04-splits/blob/main/splits-pass-through-wallet/src/PassThroughWalletImpl.sol#L124-L128However, there is no limitation that how many number of tokens a caller can be assigned into the
tokens_
array parameter. This lead to reaching a gas limit and therefore this transaction will be reverted in the for-loop if a user assign too many number of tokens into thetokens_
array parameter.Impact
The transaction will be reverted due to reaching a gas limit in the for-loop within the PassThroughWalletImpl#
passThroughToken()
.Code Snippet
Tool used
Manual Review
Recommendation
Consider setting a limitation that how many number of tokens a caller can be assigned into the
tokens_
array parameter when the PassThroughWalletImpl#passThroughToken()
would be called.