The withdrawInheritedFunds()
function in InheritanceManager
contract lacks reentrancy protection, making it vulnerable to Denial of Service (DOS) attacks from malicious beneficiaries. The contract does have a nonReentrant
` modifier, but it's incorrectly implemented and not applied to this critical function:
The function iterates through beneficiaries and makes external calls to each one when distributing ETH. Since these calls are made before completing the function, a malicious contract as a beneficiary can launch a DOS attack by consuming all gas in its receive()
function, causing the entire transaction to fail.
A malicious beneficiary can prevent ANY distribution of assets to legitimate beneficiaries by making the transaction revert. Permanent denial of service: Since the list of beneficiaries cannot be modified after inheritance is activated (isInherited = true), a single malicious actor can permanently block the core functionality of the contract. The primary purpose of this contract (asset inheritance) becomes impossible to fulfill.
Apply the nonReentrant modifier. But first you need to fix the existing nonReentrant modifier, because in the current implementation it's broke
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.