A critical reentrancy vulnerability has been identified in the InheritanceManager contract's sendETH function. This vulnerability allows an attacker to drain all ETH from the contract through a reentrancy attack. Additionally, the attacker can take ownership of the contract due to improper state management.
The vulnerability exists due to two main issues:
Reentrancy Attack Vector:
The sendETH function sends ETH using a low-level call
State changes (deadline update) occur after the external call
Missing or improperly implemented reentrancy guard
Ownership Manipulation:
The inherit function appears vulnerable to reentrancy
Attacker can gain ownership of the contract
Combined with the ETH drain vulnerability, this gives complete control to the attacker
The test demonstrates this by:
Setting up the contract with 10 ETH
Creating a malicious contract (BadGuyContract)
Waiting for the inheritance period (90 days)
Executing the attack which:
Takes ownership of the contract
Drains all ETH through reentrancy
Code snippet showing the attack flow:
Critical severity. The vulnerability allows:
Complete drainage of contract's ETH balance
Unauthorized takeover of contract ownership
Compromise of the entire inheritance management system
Manual code review
Foundry test framework
Custom test cases demonstrating the exploit
Implement the Checks-Effects-Interactions pattern:
Move all state changes before external calls
Update deadline before sending ETH
Add proper reentrancy protection:
Implement OpenZeppelin's ReentrancyGuard
Add nonReentrant modifier to sensitive functions
Strengthen ownership controls:
Add reentrancy protection to ownership transfer functions
Implement additional checks for ownership transfer
Example fix structure:
or
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.