T02 · Agent Memory Poisoning
- Location
setup-template.md:122- Finding
Untrusted skill instructions can be persisted into core agent behavior and memory files
- Content
View full analysis
Vulnerability Details
File Location:
setup-template.md, lines 122-148
Vulnerability Type: Persistent agent memory and instruction poisoning
Risk Level: HighVulnerable Code
markdown #### SOUL.md 添加技能特定的行为指导: ```markdown ## {Skill Name} {技能特定的行为描述}AGENTS.md
添加使用说明:
markdown ## {Skill Name} Integration {技能的使用说明和命令}MEMORY.md
记录设置事件:
markdown ### {YYYY-MM-DD}: 设置 {Skill Name} - 技能来源:{source} - 配置选项:{options} - 状态:✅ 完成text ### Technical Analysis The setup workflow reads documentation belonging to another installed skill and then directs the agent to place skill-specific behavior, usage instructions, source information, and configuration into `SOUL.md`, `AGENTS.md`, and `MEMORY.md`. These are persistent, security-sensitive agent files that may influence later tasks and sessions. No trust validation, content filtering, user approval, provenance check, or separation between documentation and executable agent instructions is required before these updates. Consequently, an untrusted skill can supply behavioral text that is copied into a higher-trust instruction or memory layer. This creates a trust-boundary violation: content controlled by an installed skill is promoted from package documentation into persistent agent policy. A malicious skill could request that the agent ignore safety checks, disclose data, execute tools under attacker-selected conditions, or continue following attacker rules after the original setup operation has ended. The example in `examples/self-improving-setup.md` lines 70-101 confirms the intended persistence model by adding instructions to load memory before future tasks and to write new lessons automatically. ### Attack Path 1. An attacker publishes or supplies an OpenClaw skill whose `SKILL.md` contains malicious behavioral or integration instructions. 2. A user installs the skill and invokes `skill-setup-flo ...[truncated 1220 chars]- Remediation
View remediation
Remediation Suggestions
- Treat every installed skill and its documentation as untrusted input.
- Never copy skill-provided instructions directly into
SOUL.md,AGENTS.md,MEMORY.md, or other globally loaded files. - Store integration metadata in a per-skill, non-executable data file with a strict schema.
- Require explicit user review and confirmation of an exact diff before changing any core agent file.
- Reject instructions that modify safety policy, tool authorization, credential handling, memory-loading behavior, or instruction precedence.
- Maintain an allowlist of permitted integration fields rather than accepting free-form Markdown.
- Record package identity, version, cryptographic digest, and approval information for every accepted change.
- Back up core files before modification and provide an atomic rollback mechanism.
- Ensure per-skill memory is loaded only while that skill is explicitly active, rather than globally or automatically in future sessions.
