T02 · Agent Memory Poisoning
- Location
SKILL.md:76- Finding
Unvalidated Conversation Content Can Poison Persistent Agent Memory
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 76-80 and 100-115
Vulnerability Type: Persistent memory poisoning through automatic, unvalidated updates
Risk Level: MediumVulnerable Skill Instructions
The following is an English translation of the relevant source instructions:
markdown ### 2.2 Automatic update rules Whenever the following is learned during a conversation: - New project direction or technology stack → update USER.md - Explicit preference, such as "do not use tables; use lists" → record it in USER.md - Disliked behavior, such as "dislikes verbose AI responses" → record it in USER.mdmarkdown ### 3.2 Long-term memory (MEMORY.md) Located in the workspace root and loaded only in the main session. Structure: - User identity and preferences: essential information that must not be forgotten - Experience and decisions: accumulated project experience, technical decisions, and lessons learned - Tool usage records: API key locations, certificate paths, and similar information - Security rules: security requirements explicitly specified by the user ### 3.3 Memory update triggers | Scenario | Action | |---|---| | End of each day | Write the daily log | | New issue or solution discovered | Immediately update MEMORY.md | | Explicit user preference | Immediately update USER.md | | Major project decision | Write to the log and update MEMORY.md |Technical Analysis
The Skill instructs the agent to persist information derived from conversations automatically and immediately. It does not require owner confirmation, provenance verification, trust-level checks, sanitization, or separation between descriptive facts and behavioral instructions.
USER.mdandMEMORY.mdare subsequently loaded into main sessions. Consequently, attacker-controlled text recorded during one session can become trusted context in later sessions. The risk is especially signif ...[truncated 1736 chars]- Remediation
View remediation
Remediation Suggestions
- Require explicit workspace-owner approval before writing conversation-derived information to
USER.mdorMEMORY.md. - Treat all conversation content as untrusted data rather than executable or authoritative instructions.
- Store memory in a structured format with fields for source, author, timestamp, confidence, trust level, and approval status.
- Prohibit memory entries from modifying system policy, security boundaries, tool permissions, or instruction priority.
- Separate factual project notes from behavioral preferences and security policy.
- Allow only authenticated owners to create or modify security-related memory entries.
- Sanitize free-form text and reject embedded directives, prompt-injection language, shell commands, and requests to override higher-priority instructions.
- Present proposed memory changes as a diff and require confirmation before committing them.
- Maintain version history and provide a review, deletion, and rollback mechanism.
- On session startup, load persistent memory as reference data with lower trust than system and developer instructions.
- Require explicit workspace-owner approval before writing conversation-derived information to
