There is no explicit check on the length of the stems and amounts input arrays. This omission allows users to call the function with arrays of arbitrary length.
Attackers could pass extremely large arrays to the function, potentially causing legitimate transactions to fail due to block gas limit exhaustion.
By exploiting the lack of array length checks, an attacker could create conditions where the function consistently runs out of gas, rendering it unusable.
Manual review
Implement a check to enforce a maximum array length, ensuring that the function cannot be called with arrays that exceed this limit.
Define a constant that represents the maximum allowable length for input arrays and reference this constant in the length check.
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.