Unbounded loop in accrueAll(),whitelistTokens(),whitelistSpells(),whitelistContracts() can lead to DoS
Vulnerability Detail
If a very large array of token/spell/contract addresses is passed in the mentioned functions then the the loop inside has to iterate through all of that & perform all the instructions.With all of this happening in the loop and costing gas it may revert due to exceeding the block size gas limit.
Impact
Execution fails due to exceeding the block size gas limit
sayan_
medium
gas limit DoS via unbounded loop
Summary
Unbounded loop in accrueAll(),whitelistTokens(),whitelistSpells(),whitelistContracts() can lead to DoS
Vulnerability Detail
If a very large array of token/spell/contract addresses is passed in the mentioned functions then the the loop inside has to iterate through all of that & perform all the instructions.With all of this happening in the loop and costing gas it may revert due to exceeding the block size gas limit.
Impact
Execution fails due to exceeding the block size gas limit
Code Snippet
BlueBerryBank.sol#L261-#L265
BlueBerryBank.sol#L140-#L146
BlueBerryBank.sol#L158-#L164
BlueBerryBank.sol#L176-#L181
Tool used
Manual Review
Recommendation
Consider avoiding all the actions executed in a single transaction, especially when calls are executed as part of a loop.