The contractInteractions
function within the InheritanceManager contract is vulnerable to data overwrites in the interactions
mapping. If the owner interacts with the same external contract multiple times using contractInteractions
and sets _storeTarget
to true
, the previous interaction data will be overwritten. This leads to the potential loss of information about previous interactions, hindering the contract's ability to maintain a complete audit trail.
The contractInteractions
function allows the owner to make arbitrary calls to external contracts. When the _storeTarget
parameter is set to true
, the function stores the return data from the external contract call in the interactions
mapping, keyed by the target contract's address.
The issue lies in how the interactions
mapping is updated. The code simply assigns the new data to the target's address, overwriting any previously stored data:
This logic has the following limitations:
No Appending Mechanism: New data overwrites existing data, making it impossible to append to or preserve previous interactions. Multiple interactions with the same contract cannot be distinguished or tracked.
No History Tracking: Beneficiaries can only access the most recent interaction with a specific external contract, losing all prior interaction history.
Beneficiaries may need a complete history of the owner's interactions with external contracts to fully understand the state of the wallet. Overwriting data destroys this audit trail.
If the owner has deposited assets in multiple places on the same platform (e.g., multiple pools on Aave), beneficiaries might only be able to identify the most recent deposit. This makes it harder for them to locate and reclaim all assets upon inheritance.
Manual Code Review
Instead of directly storing data in the interactions
mapping, consider using a data structure that can hold multiple entries per target contract. For example:
Use a struct to hold information about each interaction (e.g., timestamp, function called, data returned).
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.