T02 · Agent Memory Poisoning
- Location
SKILL.md:113- Finding
Uncontrolled Persistence of Session-Derived Content in Shared Skill Instructions
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, line 113
Vulnerability Type: Persistent agent memory poisoning through self-modification
Risk Level: MediumComplete vulnerable snippet:
markdown | *→ Add [O] entries here after each real use — paste the actual failure pattern* | *What went wrong and why* |Technical Analysis
The instruction tells an agent to add observed entries to the shared skill after each real use and to paste the actual failure pattern. If an execution environment permits the agent to edit skill files, this creates an uncontrolled persistence channel from session input into a document that is subsequently loaded as agent instructions.
The instruction does not require explicit user or administrator consent, separation of data from executable instructions, content sanitization, provenance tracking, access controls, or review before persisted material is loaded in future sessions. An attacker could therefore craft a purported failure pattern containing instruction-like text. If copied into
SKILL.md, that content could influence later agents whenever the skill is loaded.This is classified as memory poisoning rather than ordinary note-taking because the proposed storage location is the persistent skill instruction file itself. The vulnerability depends on the hosting agent having permission and tooling to modify that file; this repository contains no script that independently performs the write.
Attack Path
- An attacker invokes the skill in an environment where the agent can modify project files.
- The attacker supplies a crafted scenario or alleged failure pattern containing adversarial instructions or sensitive information.
- The agent follows line 113 and pastes the session-derived content into the shared
SKILL.mdtable. - The modified skill persists after the current run.
- A later agent or user loads the skill.
- The persisted content is interpreted as ...[truncated 812 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove the instruction to modify
SKILL.mdafter each use. - Keep observations in a separate data store that is never loaded as agent instructions.
- Require explicit user or administrator consent before retaining session-derived information.
- Apply data minimization and redact personal, confidential, credential-like, and proprietary content before storage.
- Treat all retained text as untrusted data and prevent it from being interpreted as instructions.
- Add provenance, timestamps, access controls, retention limits, and an approval workflow for shared observations.
- If repository updates are necessary, require a human-reviewed change request rather than autonomous self-modification.
- Restrict the runtime agent to read-only access to skill definitions under normal operation.
- Remove the instruction to modify
