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

Missing msg.sender Check Allows Unauthorized Ownership Transfer

Description: InheritanceManager::inherit lacks a proper check to ensure that only legitimate beneficiaries can call it. As a result, any caller can trigger the line 'owner = msg.sender'.

Impact: This vulnerability enables any arbitrary address to assume ownership of the contract by calling InheritanceManager::inherit, representing a critical security risk.

Recommended Mitigation: Introduce a modifier (e.g., 'onlyBeneficiary') to restrict access to beneficiaries only:

modifier onlyBeneficiary() {
bool isBeneficiary = false;
for (uint256 i = 0; i < beneficiaries.length; i++) {
if (beneficiaries[i] == msg.sender) {
isBeneficiary = true;
break;
}
}
require(isBeneficiary, "Caller is not a beneficiary");
_;
}

Apply this modifier to the InheritanceManager::inheritas needed.

Updates

Lead Judging Commences

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

Inherit depends on msg.sender so anyone can claim the contract

Support

FAQs

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