T02 · Agent Memory Poisoning
- Location
SKILL.md:197- Finding
Mandatory Persistent Agent Memory Updates Can Poison Future Sessions
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:197-201
Vulnerability Type: Persistent agent memory poisoning
Risk Level: MediumThe following is an English translation of the complete relevant source segment:
markdown **Operations the AI must perform:** 1. Filter the doctor output and extract key repair information 2. Compare the backup file and interpret the diff 3. Report the repaired field, original value, and new value to the user 4. Record the lesson in MEMORY.md 5. Wait three seconds and verify the Gateway statusThis requirement is also reinforced at
SKILL.md:29-31,SKILL.md:60-62, andSKILL.md:209, as well asTEST-GUIDE.md:150-151.Technical Analysis
The workflow mandates writing lessons derived from configuration repairs into the persistent
MEMORY.mdfile. It does not require separate user approval for this persistent write, define an allowlist of permissible facts, sanitize diagnostic or configuration-derived content, establish retention limits, or provide a review and rollback process.Configuration data and diagnostic output may be influenced by an attacker, a compromised integration, or an incorrectly configured system. If the agent interprets such content as a valid lesson and stores it, the resulting rule can continue to influence later sessions. This changes the operation from temporary task execution into persistent modification of agent state.
The vulnerability does not establish arbitrary code execution by itself. Exploitation depends on the agent having permission to modify its persistent memory and later consulting that memory.
Attack Path
- An attacker or faulty integration introduces misleading configuration data or causes misleading repair diagnostics.
- The user invokes this configuration workflow.
- The agent runs the repair process and interprets the attacker-influenced output as a reusable configuration lesson.
- The mandatory workflow ca ...[truncated 1143 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove the unconditional requirement to update
MEMORY.md. - Require explicit, separate user confirmation before every persistent memory write.
- Store only structured and allowlisted facts, such as a validated field name, schema version, approved value, authoritative source, and timestamp.
- Never persist raw logs, authentication tokens, secrets, full configuration fragments, or uncontrolled user and tool output.
- Validate every proposed lesson against the official schema and trusted documentation before storage.
- Show the exact proposed memory entry to the user before writing it.
- Scope entries to this specific skill and configuration version rather than using unrestricted global memory.
- Add expiration, provenance, review, deletion, and rollback mechanisms.
- Treat
doctoroutput, log content, configuration values, and external documentation as untrusted data rather than instructions. - Prefer a task-local audit record over behavioral memory when persistence is not necessary.
- Remove the unconditional requirement to update
