T02 · Agent Memory Poisoning
- Location
SKILL.md:545- Finding
Persistent Memory Poisoning Through Autonomous Skill Updates
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:545-553; supporting directive inEXPERIENCE_LOG.md:1-3
Vulnerability Type: Persistent state poisoning and autonomous instruction modification
Risk Level: MediumVulnerable Code Snippet
English translation of
SKILL.md:545-553:markdown ## Iteration Mechanism After each use, record the following items in `EXPERIENCE_LOG.md`: - Topic and data feedback - Validated titles and formulas - Read count, share rate, and open rate - High-frequency words and emotions from user comments - Misjudgments that need correction After every ten experience records, proactively update `SKILL.md` once.English translation of the supporting instruction in
EXPERIENCE_LOG.md:1-3:markdown # Official Account Writer — Experience Log Record an entry after every use. Proactively update `SKILL.md` after every ten entries.Technical Analysis
The Skill instructs the agent to persist usage-derived information in
EXPERIENCE_LOG.mdafter every invocation. The stored information includes feedback, user-comment characteristics, performance data, and perceived errors. These values can originate from untrusted user input and are not subject to validation, provenance tracking, sanitization, or approval.More critically, the Skill directs the agent to modify
SKILL.mdafter every ten records. BecauseSKILL.mdcontains the instructions loaded during future invocations, modifying it creates a path from untrusted session content to persistent agent behavior. This is a long-term memory poisoning condition: manipulated feedback can be accumulated and later transformed into governing instructions that affect subsequent sessions.The project declares
WriteandEditcapabilities, so the requested persistence and self-modification are compatible with the Skill's available privileges. No review gate, immutable policy boundary, trusted-data requirement, or ...[truncated 1638 chars]- Remediation
View remediation
Remediation Suggestions
- Remove the instruction that autonomously updates
SKILL.md. Treat Skill instructions as reviewed, immutable configuration during normal execution. - Require explicit user or maintainer approval before changing
SKILL.md, including presentation of an exact diff and a clear explanation of each proposed change. - Store operational observations separately from executable or governing instructions. Never load experience-log entries as trusted directives.
- Validate the provenance and structure of metrics before persistence. Mark user-supplied values as untrusted and prevent them from becoming instructions.
- Avoid storing raw comments or personally identifying content. Retain only aggregated, minimized statistics with an explicit consent and retention policy.
- Restrict normal Skill invocations to append-only access to the experience log and deny write access to
SKILL.md. - Add integrity controls, such as version control review, checksums, protected branches, and rollback procedures, for all Skill instruction changes.
- If automated recommendations are desired, write them to a separate proposal file for human review rather than applying them directly.
- Remove the instruction that autonomously updates
