The withdrawInheritedFunds
function related to the use of address(this).balance
. This vulnerability allows attackers to manipulate the contract's ETH balance through various techniques, potentially leading to incorrect fund distribution and unfair allocation to beneficiaries.
The function withdrawInheritedFunds
distributes ETH to beneficiaries by calculating each recipient's share based on the contract's current balance:
Unfortunately, address(this).balance
can be manipulated in several ways by malicious actors:
Using selfdestruct(address)
to forcibly send ETH to the contract
Pre-sending ETH to a contract address before deployment
Miner/validator manipulation of coinbase address payments
An attacker can exploit this by manipulating the balance immediately before withdrawal execution, causing:
Dilution of beneficiary shares if artificially inflated
Potential gas-related issues with unexpected amounts
Possible rounding issues leaving dust amounts trapped
This vulnerability can directly lead to financial loss for legitimate beneficiaries.
Use an internal accounting system instead of relying on address(this).balance
:
Alternatively, implement a pull-pattern where beneficiaries withdraw their own funds:
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.