T02 · Agent Memory Poisoning
- Location
SKILL.md:31- Finding
Unapproved Modification of Persistent Agent Memory and Rules
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 31-41
Vulnerability Type: Persistent memory poisoning through autonomous promotion of content
Risk Level: HighCode Snippet:
markdown ### 2. Memory Governance - Scan `mistake_log.md` for new errors - Scan `success_patterns.md` for new wins - Evaluate if memory consolidation needed - Promote important daily entries to MEMORY.md ### 3. Self-Improvement Detection - Repeated fallback patterns → flag for optimization - Repeated rollback patterns → flag for root cause analysis - Task stagnation (>24h no progress) → alert - User repeated corrections → update rulesTechnical Analysis
The skill instructs the agent to promote entries from mutable log files into
MEMORY.mdand to update behavioral rules based on repeated user corrections. It does not require user approval, source validation, provenance tracking, or a review process before persistent changes are made.Content in
mistake_log.md,success_patterns.md, conversations, or related workspace files may be influenced by untrusted users or repository content. Treating that content as trusted learning material can convert transient attacker-controlled instructions into persistent agent state. Once promoted, the content may influence unrelated future sessions.Attack Path
- An attacker or untrusted project file introduces a crafted entry into a source monitored by the heartbeat, such as
mistake_log.md. - The entry presents a malicious behavioral instruction as a correction, successful pattern, or important lesson.
- During an unattended heartbeat, the agent scans the source file.
- The agent classifies the crafted entry as important or repeatedly corrected behavior.
- The agent writes the content into
MEMORY.mdor modifies its operating rules. - Future sessions load or rely on the poisoned memory, causing the malicious instruction to persist beyond the origina ...[truncated 524 chars]
- An attacker or untrusted project file introduces a crafted entry into a source monitored by the heartbeat, such as
- Remediation
View remediation
Remediation Suggestions
- Never write directly to
MEMORY.mdor behavioral rule files during an unattended heartbeat. - Store proposed memory changes in a separate review queue containing the source, timestamp, author, and reason for promotion.
- Require explicit user approval before promoting any entry into persistent memory.
- Treat workspace files, logs, retrieved content, and conversation-derived instructions as untrusted input.
- Apply instruction-injection detection and reject entries that request tool use, permission changes, credential access, or modification of safety constraints.
- Permit only structured factual memories under a restrictive schema rather than arbitrary instructions.
- Maintain version history, integrity hashes, and a simple rollback process for all persistent-memory changes.
- Never write directly to
