A high vulnerability has been identified in the InheritanceManager contract's withdrawInheritedFunds function. The function lacks proper access control, allowing any address to trigger fund distribution after the inheritance period, potentially leading to premature or unauthorized fund distribution.
The vulnerability exists in the withdrawal mechanism:
Missing Access Control:
The withdrawInheritedFunds function lacks a modifier to restrict calls to beneficiaries only
Any external address can trigger fund distribution
No consensus mechanism among beneficiaries for withdrawal timing
Test Demonstration Shows:
Contract is set up with two beneficiaries (user1 and user2)
Contract is funded with 10e10 wei
After inheritance period (90 days):
An unauthorized address (badGuy) can call inherit()
Same unauthorized address can trigger fund distribution
Funds are distributed to beneficiaries without their consent
From the test:
The test proves this by:
Setting up contract with two beneficiaries
Funding the contract with 10e10 wei
Waiting for inheritance period
Showing that an unauthorized address can:
Call inherit()
Trigger fund distribution via withdrawInheritedFunds
Demonstrating funds are distributed:
user1 receives 5e10 wei
user2 receives 5e10 wei
Distribution occurs without beneficiary consent
High severity. The vulnerability allows:
Unauthorized triggering of fund distribution
Premature distribution of inheritance
No beneficiary control over withdrawal timing
Potential disruption of intended inheritance plans
Manual code review
Foundry test framework
Custom test cases demonstrating unauthorized withdrawal
Access control analysis
Implement proper access control:
Add withdrawal coordination mechanism:
Require multiple beneficiary signatures
Implement timelock for withdrawals
Add withdrawal voting system
Enhance security measures:
Add events for withdrawal requests
Implement withdrawal delays
Add emergency pause functionality
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.