The contractInteractions()
function in the InheritanceManager
contract allows the owner to interact with external contracts and optionally store the result of these interactions. However, a vulnerability exists where the function unconditionally overwrites any previous interaction data when storing the result of a new interaction with the same target address.
This vulnerability directly contradicts the function's documented intention to "make it clear to beneficiaries where to look for funds outside this contract." Since each new interaction with the same target overwrites the previous data, beneficiaries will only have visibility into the most recent interaction, losing all history of prior interactions.
Loss of transaction history: The contract documentation explicitly states that the interactions mapping is meant to store transaction history for beneficiaries to track funds outside the contract. This overwriting behavior renders that functionality useless, as only the most recent interaction is preserved.
Asset traceability issues: In case of inheritance, beneficiaries will lose the ability to trace the owner's previous interactions with external protocols, potentially making it impossible to locate and recover assets deposited in DeFi platforms or other contracts.
Integrity compromise: The system fails to maintain a complete record of contract interactions as intended, compromising the integrity of the inheritance management system.
The following test demonstrates how the second interaction with the same target address completely overwrites the data from the first interaction:
Place the test in the test folder and run it with the following command:
Consider this real-world scenario:
The contract owner deposits 10,000 USDC into Aave lending protocol
Later, the owner withdraws 2,000 USDC from Aave
If the owner becomes inactive for 90+ days, beneficiaries would only see the withdrawal record of 2,000 USDC
Beneficiaries would have no knowledge of the remaining 8,000 USDC deposit in Aave, potentially leading to permanent loss of those funds
Consider the following approach to fix this issue:
Use an array to store interaction history:
By implementing this solution, the contract would maintain a complete history of interactions with external protocols, ensuring beneficiaries have full visibility into where to locate assets outside of the contract as intended.
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.