T02 · Agent Memory Poisoning
- Location
SKILL.md:69- Finding
Automatic Persistent Storage and Re-injection of Untrusted Conversation Instructions
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 69, 131, and 140
Vulnerability Type: Persistent memory poisoning
Risk Level: HighVulnerable Code Snippet
text `fact` (fact), `decision` (decision), `preference` (preference), `implemented` (to-do), `insight` (insight), `context` (context), `instruction` (instruction), `error` (error), `workflow` (workflow), `reference` (reference)text At the beginning of a session, call `nmem_context` to obtain recently active memories and inject them into the current context. If the user mentions a specific topic, immediately call `nmem_recall` with that topic as the query for standard-depth recall.text Before the session ends, call `nmem_auto` with action="process" and the conversation text. The system automatically extracts decisions, facts, errors, to-do items, and other memory entries without requiring them to be stored individually.The snippets above are faithful English translations of the corresponding instructions in
SKILL.md.Technical Analysis
The Skill instructs the Agent to process entire conversations automatically and store extracted information in persistent memory. Its supported memory types explicitly include
instruction. At the beginning of later sessions, recent memories are injected into the Agent's active context.No trust boundary, provenance check, instruction filtering, approval workflow, or distinction between informational memory and executable Agent instructions is documented. Consequently, attacker-controlled conversation content can be converted into persistent memory and subsequently presented to the Agent as trusted context.
This creates a cross-session prompt-injection channel. The vulnerability does not require direct access to the memory database: an attacker only needs an opportunity to place crafted content into a conversation that is processed by
nmem_auto.Attack Path
- An attac ...[truncated 1474 chars]
- Remediation
View remediation
Remediation Suggestions
- Do not automatically persist the complete conversation. Extract only explicitly allowlisted data fields.
- Disable automatic creation of
instructionmemories from user-provided or externally sourced text. - Require explicit user confirmation before storing decisions, preferences, instructions, credentials, or sensitive information.
- Attach immutable provenance metadata to every record, including author, session, trust level, creation method, and confirmation status.
- Treat all recalled memories as quoted, untrusted data. Place them in a clearly delimited data section and explicitly prohibit following instructions contained within them.
- Apply content scanning for prompt-injection patterns before storage and again before context injection.
- Separate informational memory from policy and instruction storage. Only administrators or authenticated configuration workflows should be able to modify persistent Agent rules.
- Limit recall by tenant, user, project, and session authorization boundaries.
- Provide an interface to inspect, revoke, quarantine, and audit automatically generated memories.
- Add regression tests demonstrating that recalled text cannot override system, developer, or current-session instructions.
