The inheritanceManager::withdrawInheritedFunds
function iterates over the inheritanceManager::beneficiaries
list and transfers funds to each beneficiary using a .call{value: amountPerBeneficiary}("")
for ETH withdrawals. If any beneficiary is a contract that does not implement a receive or fallback function, the transaction will revert, preventing all beneficiaries from withdrawing funds.
If any of the beneficiaries[i] is a contract that cannot receive ETH, the call operation will fail. Since Solidity reverts the entire transaction on failure, all other beneficiaries will also be blocked from receiving funds.
Paste the test_withdrawInheritedFundsEtherFailInLoop
test into inheritanceManagerTest.t.sol
file, and Paste the attacker contract below inheritanceManagerTest.t.sol
contract.
Result: The entire inheritanceManager::withdrawInheritedFunds
function reverts, meaning no beneficiary can withdraw funds.
All withdrawals fail if any single beneficiary is a contract that cannot receive ETH.
ETH can remain stucked in the contract forever.
Legitimate beneficiaries are unfairly blocked from withdrawing their inheritance.
Can be exploited by a malicious beneficiary deploying a contract without a receive function to DOS withdrawals.
Foundry
Allow Manual Withdrawals: Instead of sending ETH in a loop, allow each beneficiary to withdraw manually using a pull-over-push approach. This prevents a single failing address from blocking all other 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.