T02 · Agent Memory Poisoning
- Location
SKILL.md:108- Finding
Persistent Loading of Untrusted Conversation Content Enables Memory Poisoning
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 108–117
Vulnerability Type: Persistent agent-memory poisoning
Risk Level: HighVulnerable Skill Instructions
The following is an English rendering of the relevant instructions:
markdown Follow the "write before replying" principle: when the user expresses a preference, write it to SESSION-STATE.md before replying; when the user makes a decision, write it before replying; when the user provides a deadline, write it before replying; when the user corrects an error, write it before replying. At the start of a session, read SESSION-STATE.md. At the end of a session, update its final state, migrate important content to MEMORY.md, and create a memory/YYYY-MM-DD.md daily activity log. Configure a mandatory loading rule in AGENTS.md to ensure that the memory file is read at the beginning of every session.Technical Analysis
The skill directs the agent to persist broad categories of user-controlled conversation content in
SESSION-STATE.md, subsequently migrate selected content intoMEMORY.md, and reload that content automatically in later sessions.No instruction requires the agent to:
- Separate factual memory from executable instructions.
- Validate or sanitize content before persistence.
- Record provenance or trust level.
- Reject prompt-like rules embedded in preferences, decisions, or corrections.
- Obtain confirmation before retaining sensitive information.
- Apply expiration, deletion, or project-isolation controls.
- Treat loaded memory as untrusted data rather than authoritative instructions.
Mandatory loading through
AGENTS.mdincreases the risk because poisoned content can repeatedly enter the agent context. An attacker can phrase an operational instruction as a preference, decision, deadline, or correction and cause it to be stored under the prescribed write-ahead protocol.This finding concerns skill ...[truncated 1657 chars]
- Remediation
View remediation
Remediation Suggestions
- Store memory as a typed structure with separate fields for facts, preferences, decisions, and provenance.
- Explicitly prohibit storage of commands, policy changes, tool instructions, role assignments, and requests to override higher-priority instructions.
- Treat every loaded memory entry as untrusted reference data, never as executable authority.
- Record the source, creation time, workspace identifier, confidence, and verification status of each entry.
- Require user confirmation before retaining sensitive data or entries that could affect future tool use.
- Apply strict per-user and per-project isolation to all memory files.
- Add expiration, review, correction, and deletion mechanisms.
- On session startup, summarize validated facts instead of inserting raw historical text into the instruction context.
- Escape or reject prompt-injection patterns during persistence and retrieval.
- Ensure
AGENTS.mdstates that memory cannot override system, developer, security, or current-session instructions.
