The code features a function, claimFertilized
, that retrieves data related to fertilizers. However, if there are too many fertilizers, the function may run out of gas while attempting to return them all. To mitigate this risk, it's advisable to implement mechanisms such as allowing for a start offset and maximum length. This way, data can be returned in batches that don't exceed gas limits. The arises due to unbounded gas consumption in the external call to the beanstalkUpdate
function, exacerbated by the use of an array both locally and in the external call.
The claimFertilized
function features an external call to the beanstalkUpdate
function, passing an array (ids
) as an argument. Additionally, the function itself iterates over the ids
array locally. This dual usage of the array may lead to increased gas consumption, especially if the array size is unbounded or unexpectedly large.
High Gas Consumption: If the ids array is large, the gas cost of the claimFertilized
function can become substantial. Each iteration over the array consumes gas, and if the array size is unbounded or unexpectedly large, it could lead to out-of-gas errors or prohibitively expensive transactions.
Potential Denial of Service (DoS): An attacker could potentially exploit this vulnerability by passing a large or infinite-sized array as the ids argument, causing excessive gas consumption and blocking other transactions from being processed due to high gas usage.
Manual code review was used to identify this potential vulnerability.
Limit Array Size: Implement measures to limit the size of the ids array passed to the claimFertilized
function. This could include pagination, batch processing, or imposing a maximum array size to prevent excessive gas consumption.
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.