The manageUsersInPrivatePool
function in the Distribution
contract lacks bounds checking when iterating over the users_
and amounts_
arrays, which may result in array out-of-bounds errors.
The function manageUsersInPrivatePool
iterates over the users_
and amounts_
arrays without verifying that the array lengths match. If the lengths differ, it could lead to accessing non-existing elements and result in array out-of-bounds errors.
The lack of bounds checking may lead to runtime errors, causing unexpected behavior or contract failure. An attacker could potentially exploit this vulnerability to manipulate the array lengths and cause the contract to behave in unintended ways.
No specific tools were used to identify this issue; it was identified through manual code review.
Implement bounds checking to ensure that the lengths of users_
and amounts_
arrays match before iterating over them. Additionally, consider handling potential length mismatches gracefully by reverting with a descriptive error message if the lengths do not match.
Adding the check require(users_.length == amounts_.length, "DS: array lengths do not match");
ensures that the array lengths are consistent before proceeding with the iteration, preventing array out-of-bounds errors.
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.