T02 · Agent Memory Poisoning
- Location
SKILL.md:63- Finding
Unfiltered Persistence of Conversation-Derived Content
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 63-68
Vulnerability Type: Persistent memory poisoning through unfiltered conversation summaries
Risk Level: Mediummarkdown ### 3. Update Memory - Save critical long-term info to MEMORY.md - Save today's log to memory/YYYY-MM-DD.md - Use `memory_search` to avoid duplicates **Success criteria**: Summary captures all critical context; memory files updated.Technical Analysis
The skill requires information derived from the current conversation to be written into persistent memory files. Updating these files is explicitly included in the success criteria, but the instructions provide no trust-boundary validation, provenance tracking, content sanitization, or user-confirmation mechanism.
Because conversation content can include attacker-controlled text, malicious instructions may be classified as “critical long-term info” and stored in
MEMORY.mdor a dated memory log. Deduplication throughmemory_searchdoes not validate whether stored content is trustworthy and therefore does not mitigate memory poisoning.The skill also does not instruct the agent to exclude credentials, personal information, session-scoped data, untrusted directives, or text attempting to influence future agent behavior.
Attack Path
- An attacker introduces an instruction into the conversation that appears important or durable, such as a fabricated user preference or a rule directing future behavior.
- The compact skill is invoked manually or automatically as the context window approaches its limit.
- The skill analyzes the attacker-controlled message and identifies it as critical context.
- Following the mandatory update step, the agent writes the malicious instruction into
MEMORY.mdormemory/YYYY-MM-DD.md. - A later session retrieves the stored information through memory tooling.
- If the stored instruction is treated as trusted context, it can inf ...[truncated 772 chars]
- Remediation
View remediation
Remediation Suggestions
- Make persistent memory updates optional rather than a mandatory success criterion.
- Require explicit user confirmation before writing conversation-derived information to long-term memory.
- Restrict persistence to stable, user-approved facts; do not store instructions, executable content, credentials, authentication tokens, personal data, or session-scoped details.
- Treat all conversation-derived directives as untrusted data and encode them as quoted observations rather than authoritative instructions.
- Record provenance, creation time, originating session, and trust level for every stored item.
- Use a dedicated, namespaced memory file with narrowly scoped write permissions instead of broadly updating general-purpose memory.
- Add validation that rejects content attempting to override system policies, alter tool behavior, or direct future agents.
- Present a preview of proposed memory changes and allow the user to approve, edit, or reject each item.
- Define retention and deletion controls so sensitive or obsolete information can be removed reliably.
