A high severity vulnerability has been identified in the InheritanceManager contract's storage management for contract interactions. The current implementation allows data collisions in the interactions mapping, potentially leading overwritten contract interaction data or losing funds if interaction is forgotten.
The vulnerability exists in the storage structure for contract interactions:
Current Implementation Issue:
Uses a simple mapping: mapping(address protocol => bytes) public interactions
Each protocol address can only store one interaction
New interactions override previous ones for the same protocol address
Test Demonstration:
Two different interactions are created for the same contract:
"create short order call1"
"stake funds call2"
When both are stored, only the latest interaction data remains
The test confirms this by showing the second interaction data overwrites the first
From the test:
High severity. The vulnerability allows:
Loss of funds based on loss of historical interaction data
Loss of historical interaction data
Potential disruption of protocol interaction sequences
Inability to maintain multiple different interactions with the same protocol
Manual code review
Foundry test framework
Mock contract calls for testing
Storage layout analysis
Implement nested mapping structure:
Add interaction ID management:
Implement counter per protocol address
Allow explicit interaction ID specification
Add methods to query available interactions
Enhance data structure with additional features:
Add timestamp for interactions
Include status flags (active/inactive)
Implement interaction deletion capability
Example fix structure:
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.