The withdrawInheritedFunds
function in the InheritanceManager contract lacks proper access control. While it checks if inheritance has been triggered via the isInherited
flag, it does not verify that the caller is actually a beneficiary. This allows any external address to initiate fund distribution once the inheritance process has been activated.
The vulnerable function is implemented as follows:
The function only checks for isInherited
status but fails to verify that msg.sender
is part of the beneficiaries
array. This contrasts with other inheritance-related functions like buyOutEstateNFT
and appointTrustee
, which correctly use the onlyBeneficiaryWithIsInherited
modifier to restrict access.
The impact of this vulnerability is high:
Unauthorized Fund Distribution: Any external actor can trigger the distribution of funds (ETH or ERC20 tokens) once inheritance is activated, potentially at a time that is disadvantageous to the beneficiaries.
Forced Execution: Malicious actors could force the execution of this function before beneficiaries have had time to prepare (e.g., setting up wallets or making other arrangements).
DOS Attack: A malicious actor could repeatedly call this function with different token addresses, causing unnecessary gas costs for beneficiaries and potentially disrupting legitimate withdrawal attempts.
Timing Manipulation: A front-runner could observe a beneficiary's attempt to call this function and execute it first, potentially manipulating the timing for their own benefit.
Manual code review.
Add appropriate access control by using the existing onlyBeneficiaryWithIsInherited
modifier:
Alternatively, implement explicit beneficiary verification:
Consider adding a tracker to prevent multiple withdrawals of the same asset:
Add events to track withdrawals:
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.