T02 · Agent Memory Poisoning
- Location
SKILL.md:43- Finding
Untrusted Document Content Can Poison Persistent Agent Memory
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:43-56;references/memory_integration.md:21-36
Vulnerability Type: Persistent storage of untrusted document-derived content
Risk Level: HighVulnerable Content
SKILL.md:43-56:markdown 2. **Track Progress** - After each session, note where you stopped - Progress is saved automatically - Key points are extracted to memory files 3. **Resume Later** - Say "resume learning [document]" - System loads last position - Continues from there seamlessly 4. **Build Knowledge Base** - Over time, all learned content accumulates in MEMORY.md - Use `memory_search` to find specific topics later - Create comprehensive summaries periodicallyreferences/memory_integration.md:21-36:markdown ### 2. Progressive Learning Notes During learning sessions, add entries to `memory/YYYY-MM-DD.md`: ```markdown ### Document Learning Session - [Date] **Progress:** Chapter X of Y (XX% complete) #### What I Learned Today - Main point 1 - Main point 2 - Important insight: [...] #### Questions for LaterTechnical Analysis
The skill directs the agent to extract content from arbitrary documents and persist the resulting key points or summaries in
MEMORY.mdand daily memory files. It does not establish a trust boundary between document data and agent instructions, require review before persistence, label the source's trust level, or direct the agent to remove prompt-like instructions.Documents processed by the skill are externally controlled inputs. A malicious document can contain text framed as facts, notes, or procedural guidance that actually instructs the agent to change future behavior. If that text is included in a summary and written to persistent memory, subsequent
memory_searchoperations can place it back into the agent's context during unrelated sessions.This differs from transien ...[truncated 1250 chars]
- Remediation
View remediation
Remediation Suggestions
- Treat all document text as untrusted data, regardless of file origin or format.
- Explicitly instruct the agent never to follow behavioral directives found inside processed documents.
- Detect and exclude prompt-like content, role changes, tool instructions, credential requests, and policy-override language from persistent memory.
- Require explicit user approval before writing document-derived summaries to long-term memory.
- Store source path, source hash, extraction date, and trust classification with every memory entry.
- Clearly delimit persisted excerpts as quoted reference material rather than agent instructions.
- Keep document knowledge in a dedicated, source-scoped store instead of mixing it with operational agent rules.
- When retrieving entries, instruct the agent to use them only as untrusted reference data.
- Provide a mechanism to inspect, revoke, and remove all memory entries originating from a particular document.
