The GlobalConfigurationBranch:getAccountsWithActivePositions function lacks proper validation for the upperBound parameter, potentially leading to out-of-bounds errors. This vulnerability could result in incorrect data retrieval and potential disruption of the system's operations.
The getAccountsWithActivePositions function retrieves a list of accounts with active positions between specified lower and upper bounds. However, it does not validate if the upperBound parameter is within the size of the accountsIdsWithActivePositions set. This can lead to out-of-bounds errors, causing the function to revert or return incorrect data.
See the following code:
This vulnerability can cause the following issues:
Out-of-Bounds Error: The function may revert, causing disruptions in the system's operations.
Incorrect Data Retrieval: The function may return incorrect data, affecting the accuracy and reliability of the system.
Manual Review
To mitigate this vulnerability, validate the upperBound parameter to ensure it is within the size of the accountsIdsWithActivePositions set before proceeding with data retrieval.
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.