The onlyBeneficiaryWithIsInherited modifier in the InheritanceManager contract uses a while loop to iterate over the beneficiaries array. If the array grows too large, this could lead to a denial-of-service (DoS) attack due to excessive gas consumption. It could also cause an out-of-bounds error if no match is found.
Code:
Issue: A large beneficiaries array could make the contract unusable due to high gas costs
A DoS attack could make the contract unusable.
Manual review
Use a mapping instead of array:
Change while (i < beneficiaries.length + 1) to while (i < beneficiaries.length) to prevent 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.