Beginner FriendlySolidity
100 EXP
View results
Submission Details
Severity: high
Valid

Improper handling of deleting elements from the beneficiary array.

Summary

  1. Improper handling of deleting array elements with `_beneficiary` array

Vulnerability Details

function removeBeneficiary(address _beneficiary) external onlyOwner {
uint256 indexToRemove = _getBeneficiaryIndex(_beneficiary);
delete beneficiaries[indexToRemove];
}

Impact

  1. Functions that use this array will lead to errors such as the -

    function withdrawInheritedFunds(address _asset) external {
    if (!isInherited) {
    revert NotYetInherited();
    }

and this function

function buyOutEstateNFT(uint256 _nftID) external onlyBeneficiaryWithIsInherited {{
.....
}

Tools Used

  1. Manual review of elemental structures of code

  2. Reference against similar cases with problematic data structures

  3. AI for understanding impact of the errors

Recommendations

  1. Proper handling of removing elements from the array

Special Considerations

  1. At the current moment in time I am a beginner in reading solidity code and am unable to provide a fully fleshed out poc. That would be possible after I understand how to use foundry vm pranks. etc.

Updates

Lead Judging Commences

0xtimefliez Lead Judge
4 months ago
0xtimefliez Lead Judge 4 months ago
Submission Judgement Published
Validated
Assigned finding tags:

Incorrect removal from beneficiary list causes funds to be send to 0 address

0xtimefliez Lead Judge 4 months ago
Submission Judgement Published
Validated
Assigned finding tags:

Incorrect removal from beneficiary list causes funds to be send to 0 address

Support

FAQs

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