The _depositLiquidity function in the StakingPool contract lacks sufficient validation for the _data parameter, which can lead to unintended behavior or potential exploits. This vulnerability arises because the function does not verify that the length of _data matches the number of strategies, potentially causing incorrect data to be passed to strategies.
The function _depositLiquidity currently only checks if toDeposit is greater than zero, without validating the length of _data.
Scenario:
An attacker calls a function that triggers the _depositLiquidity function with a _data array that has fewer elements than the number of strategies.
The function iterates over the strategies and attempts to pass data from the _data array to each strategy.
Due to the mismatch in the length of _data and the number of strategies, some strategies may receive incorrect or no data, leading to potential errors or unintended behavior.
Strategies receive incorrect data, leading to operational failures or unexpected behavior.
Manual review
add a validation check to ensure that the length of _data matches the number of strategies before proceeding with the deposit logic.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.