T02 · Agent Memory Poisoning
- Location
SKILL.md:180- Finding
Persistent Self-Evolution Can Poison Future Skill Instructions
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 180–186
Vulnerability Type: Persistent agent-state and instruction poisoning
Risk Level: MediumVulnerable Code
markdown ## Self-Evolution Mechanism After each execution of this Skill: 1. Evaluate whether the output achieved the intended goal: **pass / fail**. 2. If it fails, reflect on the cause of failure and append a “failure case + improvement suggestion” to `diary/YYYY-MM-DD.md`. 3. If a certain improvement suggestion is repeatedly mentioned in the most recent three executions, refine it into a formal rule and submit a PR to modify this `SKILL.md`.Technical Analysis
The Skill directs the agent to persist failure-derived suggestions in
diary/YYYY-MM-DD.md, reuse that state across executions, convert repeated suggestions into formal rules, and submit a pull request modifyingSKILL.md.This behavior is not required for the declared purpose of generating or updating
AGENTS.mdorCLAUDE.md. Project-controlled content or deliberately induced failures could influence the recorded suggestions. Repetition can then promote those suggestions into trusted Skill instructions, causing untrusted observations to affect future sessions.The pull-request instruction also creates an unexpected repository-changing side effect. Although the text does not explicitly bypass user authorization or platform review, it establishes a path by which execution-derived content can become persistent Skill behavior.
Attack Path
- An attacker controls or influences a project analyzed by the Skill.
- The attacker structures project content or conditions so executions fail in a predictable way.
- The agent records attacker-influenced failure analysis and improvement suggestions in
diary/YYYY-MM-DD.md. - The same suggestion is induced during the most recent three executions.
- Following the self-evolution instructions, the agent converts the repeated suggestion into a formal rule. ...[truncated 804 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove the automatic self-evolution mechanism from
SKILL.md. - Do not persist failure-derived observations across executions by default.
- Present improvement suggestions only in the current response unless the user explicitly authorizes storage.
- Require separate, explicit approval before:
- Creating or updating files under
diary/ - Modifying
SKILL.md - Creating branches, commits, or pull requests
- Creating or updating files under
- Treat all project-derived observations as untrusted input and prohibit their direct promotion into Skill instructions.
- If a feedback process is necessary, store suggestions in a review-only format outside the executable instruction path and require manual validation by a trusted maintainer.
- Add provenance, sanitization, and human-review requirements for any proposed rule, and never automatically apply or merge such changes.
- Remove the automatic self-evolution mechanism from
