The getPoolLPTokenValue function does not verify that the length of the prices array matches the length of the tokens array. This oversight can lead to runtime errors and incorrect calculations, potentially affecting the contract's functionality and reliability.
The getPoolLPTokenValue function assumes that the prices array and the tokens array have the same length, but it does not explicitly check this condition.
Lack of input validation for array lengths before performing operations that assume a one-to-one correspondence between elements of the two arrays.
If the arrays have different lengths, the function may attempt to access an out-of-bounds index, causing the contract to revert and also mismatched lengths can lead to incorrect pool value calculations, as each token's balance must correspond to a valid price.
Manual Review
Add a check to ensure that the prices array and the tokens array have the same length.
Please read the CodeHawks documentation to know which submissions are valid. If you disagree, provide a coded PoC and explain the real likelyhood and the detailed impact on the mainnet without any supposition (if, it could, etc) to prove your point.
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.