T02 · Agent Memory Poisoning
Warning
- Location
- SKILL.md:193
- Finding
- Unvalidated Bulk History Import Can Poison Persistent Agent Memory## Vulnerability Details **File Location**: `SKILL.md:193-203`, with the unsafe import behavior at `SKILL.md:232` **Vulnerability Type**: Persistent memory poisoning through untrusted history import **Risk Level**: Medium **Relevant 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 1. An attacker creates or modifies a history export containing fabricated facts, malicious guidance, or instruction-like content. 2. A user or integration invokes the bulk-history import feature. 3. The design writes the imported records directly to L6 without provenance validation or normal layer processing. 4. L6 retains the attacker-controlled content as permanent archived memory. 5. A later deep-analysis query searches L5, L4, and L6. 6. The pois ...[truncated 882 chars]
- Remediation
- ## Remediation Suggestions 1. Treat all imported history as untrusted data and attach immutable provenance, source, import time, and trust metadata. 2. Place imports in a quarantined staging layer rather than writing directly to L6. 3. Validate schema, size, encoding, and content before making records searchable. 4. Require explicit review or a controlled verification process before promoting imported records into trusted memory. 5. Ensure retrieved memory is delimited as quoted data and cannot override system, developer, user, or skill instructions. 6. Detect and flag instruction-like phrases, role directives, credential requests, and attempts to alter agent behavior. 7. Exclude unverified archive records from high-impact reasoning and decision workflows. 8. Record the source of every retrieved result and expose its trust level to downstream reasoning. 9. Support revocation so a compromised import can be removed from storage, indexes, caches, and derived consolidated memories. 10. Add adversarial tests demonstrating that malicious imported text cannot alter agent policies or persist as trusted guidance.
