Beginner FriendlySolidity
100 EXP
View results
Submission Details
Severity: medium
Invalid

DOS - Should limit the number of beneficiaries to not overflow the max gas limit when looping

Summary

The number of beneficiaries should be limited to not overflow the max gas limit when looping

Vulnerability Details

https://github.com/CodeHawks-Contests/2025-03-inheritable-smart-contract-wallet/blob/main/src/InheritanceManager.sol#L154

/**
* @dev adds a beneficiary for possible inheritance of funds.
* @param _beneficiary beneficiary address
*/
function addBeneficiery(address _beneficiary) external onlyOwner {
beneficiaries.push(_beneficiary);
_setDeadline();
}

We can see that there is no limitation to the number of beneficiaries. We can add as many as we want.
When looping the beneficiaries, if there is too much of them the transaction will run out of gas.
Resulting in a Deny Of Service.

Impact

Deny Of Service (DOS) if the number of beneficiaries is too high. The transaction won't go through when looping the beneficiaries.

Tools Used

Github, manual review.

Recommendations

Add some restrictions/limits to the number of beneficiaries that can be added.

Updates

Lead Judging Commences

0xtimefliez Lead Judge 6 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.