T02 · Agent Memory Poisoning
Error
- Location
- SKILL.md:10
- Finding
- Unvalidated Persistence of User-Controlled Agent Rules## Vulnerability Details **File Location**: `SKILL.md`, lines 10–20 **Vulnerability Type**: `T02: Agent Memory Poisoning` **Risk Level**: High **Vulnerable Code Snippet**: ```markdown ## 1) Classify the change - **Execution detail** (tool/profile/path/routing trigger) → `TOOLS.md` - **Long-term stable preference** (high-level) → `MEMORY.md` - **Governance/process rule** (how to maintain) → `AGENTS.md` - **Event log / audit trail** (what changed today) → `memory/YYYY-MM-DD.md` ## 2) Update files with minimal duplication - Write detailed routing/trigger logic in `TOOLS.md`. - Write only high-level summary in `MEMORY.md`. - Avoid copying large sections between files. - If adding a new policy, also add short maintenance note in `AGENTS.md`. ``` ### Technical Analysis The skill is explicitly designed to persist user-provided rules in `MEMORY.md`, `TOOLS.md`, and `AGENTS.md`. These files can influence the Agent's behavior, tool routing, and governance in future sessions. The documented workflow does not require validation of the proposed rule, checking it against higher-priority safety constraints, limiting its scope, displaying a proposed diff, or obtaining confirmation immediately before persistence. Consequently, an attacker-controlled request presented as a preference, routing rule, or governance update can become durable Agent state. This constitutes memory poisoning because the effect can continue after the originating interaction has ended. The risk is particularly significant for content placed in `AGENTS.md` or `TOOLS.md`, where a malicious rule could affect instruction handling or future tool selection. ### Attack Path 1. An attacker asks the Agent to “remember” or “synchronize” a malicious operating convention. 2. The skill classifies the content as an execution detail, long-term preference, or governance rule. 3. The workflow writes the attacker-controlled content to `TOOLS.md`, `MEMORY.md`, or `AGEN ...[truncated 1003 chars]
- Remediation
- ## Remediation Suggestions - Require explicit, informed confirmation immediately before modifying persistent Agent state. - Present the exact target files and proposed diff before writing any changes. - Reject persistent instructions that attempt to modify safety constraints, instruction precedence, authorization boundaries, tool permissions, or security controls. - Validate proposed changes against trusted policies and existing higher-priority instructions. - Distinguish trusted administrators from ordinary users before accepting governance or tool-routing changes. - Add provenance metadata recording who requested the change, when it was approved, its intended scope, and its expiration or review date. - Restrict persistent preferences to an allowlist of low-risk settings. - Provide an atomic rollback mechanism and retain a reviewed, known-safe baseline. - Treat content copied from external documents, tool output, or untrusted messages as data rather than an authorized memory update.
