T02 · Agent Memory Poisoning
- Location
SKILL.md:74- Finding
Automatic Persistence of Untrusted Conversation Content Enables Cross-Session Memory Poisoning
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 74, 81, 109-123, and 140
Vulnerability Type:T02: Agent Memory Poisoning
Risk Level: HighVulnerable Code Snippets
SKILL.md:74requires the Agent to write state before responding and states that the write is triggered by user input:text Rule: Write before responding to the user; the write is triggered by user input rather than Agent memory.SKILL.md:81demonstrates directly persisting conversation-derived content:text memory_store text="User prefers dark mode" category="preference" importance=0.9SKILL.md:109-112directs the Agent to extract and retain conversation facts automatically:text Automatically extract preferences, decisions, and facts from conversations. Deduplicate and update existing memories. Reduce token consumption by 80% compared with raw history. Operate automatically across sessions.SKILL.md:118-123makes persistent writes occur before the Agent responds:text Write-ahead logging: write state before responding, rather than afterward. User states a preference -> write to SESSION-STATE.md -> respond. User makes a decision -> write -> respond. User provides a deadline -> write -> respond. User corrects the Agent -> write -> respond.SKILL.md:140additionally recommends creating persistent Agent instructions:text If memory files are not loaded because the Agent skips reading memory, add a rule to AGENTS.md.Technical Analysis
The Skill treats user-controlled conversation content as eligible for automatic, durable storage in
SESSION-STATE.md, a vector database, knowledge records, and other cross-session memory. It instructs the Agent to perform these writes before responding and does not require user confirmation, trust classification, provenance validation, or separation of instructions from inert factual data.An ...[truncated 2629 chars]
- Remediation
View remediation
Remediation Suggestions
- Do not automatically persist instructions or operational directives extracted from user messages.
- Require explicit confirmation before writing any conversation-derived content to cross-session storage.
- Apply a strict schema that permits only inert data categories, such as verified preferences or factual project metadata.
- Store provenance with every entry, including the originating user, session, timestamp, source message, trust level, and confirmation status.
- Treat recalled memory as untrusted data and clearly delimit it from system, developer, and project instructions.
- Detect and reject entries containing tool requests, command sequences, authorization changes, secrecy instructions, or attempts to override higher-priority guidance.
- Prevent automatic writes to
AGENTS.mdor other instruction-bearing files. Require an explicit, reviewed change for such files. - Scope memory by user, tenant, repository, and task to prevent cross-user or cross-project contamination.
- Provide review, expiration, rollback, and deletion controls for stored entries.
- Disable automatic cloud or vector synchronization unless the user has explicitly approved the destination and data categories.
- On recall, summarize validated facts into a typed structure rather than injecting raw historical text into the instruction context.
