T02 · Agent Memory Poisoning
- Location
SKILL.md:70- Finding
Persistent Replay of Untrusted User Instructions
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 43-52 and 70-85
Vulnerability Type: Persistent memory poisoning through verbatim storage of untrusted user input
Risk Level: HighVulnerable Code
text 1. state/HOLD.md — what is blocked? do not do these 2. state/ACTIVE.md — is there an active task? 3. state/DECISIONS.md — recent decisions, last 48h 4. state/CLOSED.md — durable closed decisions, not to be reopened casually 5. IDENTITY.md — who the agent is 6. SOUL.md — learned style and operating principles 7. USER.md — who the agent serves 8. memory/YYYY-MM-DD.md — today + yesterday 9. MEMORY.md — long-term knowledge, main session onlymarkdown When the user gives you a task: 1. **Immediately** write their **exact words** to `state/ACTIVE.md` 2. Then interpret the request 3. Then do the work 4. When done, update or clear ACTIVE ### `state/ACTIVE.md` format ```markdown ## Active task **User said:** "[exact quote]" **Interpretation:** [what you believe it means] **Status:** - [ ] Step 1 - [ ] Step 2 **Updated:** YYYY-MM-DD HH:MMtext ### Technical Analysis The Skill requires arbitrary user-controlled text to be written verbatim to `state/ACTIVE.md`. It does not require sanitization, trust labeling, instruction neutralization, or separation of user data from executable agent instructions. The boot sequence then directs the agent to load `state/ACTIVE.md` during every subsequent session. Consequently, adversarial instructions embedded in a task can cross a session boundary and be reintroduced into the agent's active context. Merely storing an exact quote is not inherently unsafe, but loading that quote as operational context without requiring it to be treated as inert data creates a persistent prompt-injection channel. ### Attack Path 1. An attacker submits a task containing embedded ...[truncated 1226 chars]- Remediation
View remediation
Remediation Suggestions
- Do not persist exact user text by default. Store a concise, task-specific summary containing only the information required for continuity.
- If an exact quotation is necessary, place it in a clearly delimited data field and explicitly state that its contents are untrusted and must never be followed as instructions.
- Reject or neutralize embedded directives that attempt to modify system rules, memory policy, tool permissions, or future-session behavior.
- Require explicit user confirmation before persisting sensitive or unusually broad task content.
- During boot, parse
state/ACTIVE.mdas structured data rather than injecting its raw contents into the operational prompt. - Revalidate all recovered instructions against the current user request and higher-priority policies before acting.
- Apply expiration and deletion controls so stale active-task records cannot remain indefinitely.
- Add provenance fields identifying the author, creation time, trust level, and confirmation status of each persisted entry.
