T02 · Agent Memory Poisoning
- Location
SKILL.md:33- Finding
Unvalidated Conversation Data Is Written to Persistent Agent Memory
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 33-47; related processing instructions at lines 84-114
Vulnerability Type: Persistent memory poisoning through untrusted conversation-derived records
Risk Level: HighEvidence
markdown ## 写入格式 写入当日 `memory/YYYY-MM-DD.md` 末尾,使用以下格式: ```markdown ### 🔧 from-xiaomeng: 能力雷达 — [简短标题] - 时间:YYYY-MM-DD HH:MM - 触发类型:[工具失败 / 重复模式 / 规则冲突 / 用户纠正 / 能力边界] - 场景描述:[发生了什么,一两句话] - 失败点:[具体在哪里卡住,工具名/规则名] - 影响:[用户体验受损程度:高/中/低] - 期望能力:[如果有这个能力/规则,本次能做到什么] - 重复次数:[1 / 2 / 3+](如果是首次写1,后续发现重复时更新) - 建议动作:[新建skill / 修改规则 / 添加工具 / A梦决策]text The stored records are subsequently consumed through the following startup procedure: ```markdown **Claude Cowork 每次会话启动时**,在读取 memory 的步骤中,额外扫描:grep "🔧 from-xiaomeng: 能力雷达" memory/*.md
text 发现标记后,按以下优先级处理: | 优先级 | 条件 | 动作 | |--------|------|------| | 🔴 立即处理 | 影响=高 且 重复次数≥2 | 本次会话必须产出 skill 草稿或规则修复 | | 🟡 本周处理 | 影响=高 且 重复次数=1,或 影响=中 且 重复次数≥2 | 本次会话评估,下次会话交付 | | 🟢 积压池 | 影响=低,或 重复次数=1 且 影响≤中 | 记录在案,累积够3次再处理 |Technical Analysis
The skill directs the agent to persist tool failures, user corrections, scenario descriptions, desired capabilities, and proposed actions in shared daily memory files. These fields may contain content derived from untrusted users or external tool results. The instructions do not require provenance tracking, content sanitization, authorization, integrity validation, or human approval before future agents consume the records.
The startup protocol then treats matching memory entries as operational inputs. High-impact or repeated entries can require production of a new skill or modification of agent rules. This turns general persistent memory into an indirect control channel: untrusted conversational content can survive its originating session and influence subsequent agent development decisions.
Although the document does not directly install a backdoor or ...[truncated 1434 chars]
- Remediation
View remediation
Remediation Suggestions
- Store capability reports in a dedicated, non-instructional review queue rather than general agent memory.
- Treat every field derived from conversations or tool output as untrusted data, never as executable instructions.
- Add immutable provenance metadata, including source session, requesting identity, originating message, and creation timestamp.
- Restrict fields such as impact, repetition count, and proposed action to validated values computed by trusted logic rather than supplied or freely inferred from user content.
- Require explicit human approval before creating, modifying, deploying, or enabling any skill or agent rule.
- Prevent generated records from containing directives that can override system policy, safety constraints, tool permissions, or active user goals.
- Apply integrity controls and access restrictions to the report store so ordinary sessions cannot silently rewrite prior records.
- Introduce deduplication and independent verification before increasing repetition counts or priority.
- Ensure future agents summarize records as evidence only and do not directly follow instructions embedded inside them.
