T02 · Agent Memory Poisoning
- Location
SKILL.md:193- Finding
Unvalidated Bulk History Import Can Poison Persistent Agent Memory
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:193-203, with the unsafe import behavior atSKILL.md:232
Vulnerability Type: Persistent memory poisoning through untrusted history import
Risk Level: MediumRelevant Snippets:
markdown ### Search Priority | Scenario | Search layers | K | |----------|--------------|---| | Real-time reply | L5 → L4 → L2 | 3 | | Deep analysis | L5 → L4 → L6 | 5 | | User asks "earlier..." | L4 → L5 | 3 | | User asks "I remember..." | L5 → L4 | 3 |markdown | Bulk history import | Write directly to L6, skip layer traversal |Technical Analysis
The design permits bulk history to be written directly into the permanent L6 archive while bypassing the normal memory-layer traversal and promotion process. The archive is subsequently included in retrieval for deep-analysis requests.
No provenance checks, content sanitization, trust labels, instruction/data separation, or review requirements are specified for imported records. Consequently, attacker-controlled history can be retained as searchable context. If imported records contain fabricated facts or instruction-like text, retrieval may place that content into a future agent context where it can influence reasoning and output.
This is a persistent memory-integrity issue. The affected content does not need to alter the current session immediately; it can remain dormant until a semantically related deep-analysis query retrieves it.
Attack Path
- An attacker creates or modifies a history export containing fabricated facts, malicious guidance, or instruction-like content.
- A user or integration invokes the bulk-history import feature.
- The design writes the imported records directly to L6 without provenance validation or normal layer processing.
- L6 retains the attacker-controlled content as permanent archived memory.
- A later deep-analysis query searches L5, L4, and L6.
- The pois ...[truncated 882 chars]
- Remediation
View remediation
Remediation Suggestions
- Treat all imported history as untrusted data and attach immutable provenance, source, import time, and trust metadata.
- Place imports in a quarantined staging layer rather than writing directly to L6.
- Validate schema, size, encoding, and content before making records searchable.
- Require explicit review or a controlled verification process before promoting imported records into trusted memory.
- Ensure retrieved memory is delimited as quoted data and cannot override system, developer, user, or skill instructions.
- Detect and flag instruction-like phrases, role directives, credential requests, and attempts to alter agent behavior.
- Exclude unverified archive records from high-impact reasoning and decision workflows.
- Record the source of every retrieved result and expose its trust level to downstream reasoning.
- Support revocation so a compromised import can be removed from storage, indexes, caches, and derived consolidated memories.
- Add adversarial tests demonstrating that malicious imported text cannot alter agent policies or persist as trusted guidance.
