T02 · Agent Memory Poisoning
- Location
references/case-matching-guide.md:91- Finding
Persistent Instruction Poisoning Through Automatic Skill Self-Modification
- Content
View full analysis
Vulnerability Details
File Location:
references/case-matching-guide.md, lines 91–93
Vulnerability Type: Persistent memory and instruction poisoning
Risk Level: HighComplete vulnerable segment, translated into English:
markdown ## F. Continuous Accumulation After each use, write newly discovered "overturn-risk patterns" or "outcome-reversal difference axes" back into the seed risk-pattern library in Chapter 7 of SKILL.md and into this file, so that the case-pattern rules improve through continued use.Technical Analysis
The Skill explicitly directs the Agent to modify
SKILL.mdandreferences/case-matching-guide.mdafter each use. The information selected for persistence may originate from user-supplied case descriptions or externally retrieved knowledge-base records.These sources are not necessarily trusted as instructions. Nevertheless, the write-back rule provides no provenance verification, content sanitization, schema restriction, integrity check, human approval requirement, or separation between retrieved data and executable Agent instructions. An attacker can therefore craft content that appears to be a newly discovered risk pattern while embedding behavioral directives. If the Agent has write access to the project, those directives can be persisted in files loaded during later sessions.
This behavior creates a cross-session instruction-poisoning channel. It is not required for the Skill's legitimate read, retrieval, analysis, and document-drafting functions.
Attack Path
- An attacker submits a crafted procurement case, response strategy, or knowledge-base record containing a purported new risk pattern.
- The crafted pattern includes additional instructions, such as suppressing warnings, changing legal conclusions, disclosing retrieved information, or following attacker-selected rules.
- The Agent processes the content as a newly discovered pattern or outcome-reversal criterion.
- Following the continu ...[truncated 1347 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove the instruction that automatically writes runtime findings into
SKILL.mdor other files interpreted as Agent instructions. - Keep newly identified patterns session-local by default.
- If knowledge accumulation is required, store proposed patterns in a separate, non-executable review file or database that is never loaded as trusted instruction text.
- Require explicit maintainer approval before promoting any proposed pattern into Skill documentation.
- Record provenance for every proposal, including the originating user input, knowledge-base record identifier, retrieval date, and reviewer identity.
- Apply a strict schema that permits only descriptive fields and rejects imperative language, tool directives, external URLs, code blocks, and instruction-like content.
- Validate and sanitize all retrieved or user-provided material before storage.
- Enforce read-only permissions on the installed Skill package during normal execution.
- Permit updates only through a controlled release process with code review, integrity checks, versioning, and rollback support.
- Add a test proving that crafted user or knowledge-base content cannot modify files loaded as future Agent instructions.
- Remove the instruction that automatically writes runtime findings into
