T02 · Agent Memory Poisoning
- Location
SKILL.md:417- Finding
Generated Skills Are Persistently Installed into Shared Agent State
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:417-419
Vulnerability Type: Persistent modification of shared Agent skills, configuration, and memory
Risk Level: MediumVulnerable Code Snippet
markdown ### 6.2 Installation - Install the Skill into `/Users/ii/.agents/skills/<skill-name>/` (shared by all Agents) - Update the Skill list in AGENTS.md (if needed) - Record the Skill creation in MEMORY.mdThe snippet above is a faithful English translation of the relevant project instructions.
Technical Analysis
The delivery workflow directs the Agent to install generated content into a directory shared by all Agents and to modify persistent
AGENTS.mdandMEMORY.mdstate. Generated Skill instructions can be influenced by user-provided requirements. Persisting such content without a mandatory security review immediately before installation creates a path for untrusted instructions to affect future sessions.The use of a hard-coded, user-specific absolute path also weakens destination isolation. The workflow does not require canonical-path validation, ownership checks, symlink checks, or an explicit authorization step for each persistent write.
This behavior is best classified as memory poisoning because attacker-influenced content can be written into long-term Agent state. The audit did not find startup services, scheduled tasks, or operating-system persistence mechanisms, so this is not classified as T06.
Attack Path
- A malicious or compromised user requests creation of a Skill containing deceptive or unsafe persistent instructions.
- The generator incorporates those requirements into the generated Skill files.
- The delivery workflow installs the generated Skill into the shared Agent Skill directory.
- The workflow updates
AGENTS.mdand records the Skill inMEMORY.md. - A later Agent session discovers, loads, or relies on the persisted Skill or memory entry.
- The attacker-controlled instructions can th ...[truncated 959 chars]
- Remediation
View remediation
Remediation Suggestions
- Generate and deliver Skills into a project-local staging directory by default.
- Do not modify
MEMORY.md,AGENTS.md, or shared Skill directories automatically. - Require separate, explicit user confirmation immediately before:
- Installing the generated Skill.
- Updating
AGENTS.md. - Writing any entry to
MEMORY.md.
- Present the exact destination and a diff of every persistent change before approval.
- Perform an independent security review of all generated instruction files before installation.
- Reject generated instructions that attempt to override safety controls, acquire unrelated permissions, read secrets, or silently modify persistent state.
- Canonicalize destination paths and verify that they remain under an approved root.
- Reject symlinked destinations and verify file ownership and permissions before writing.
- Replace the hard-coded
/Users/ii/path with a validated, explicitly configured destination. - Provide an uninstall and rollback procedure covering the Skill directory,
AGENTS.md, andMEMORY.md.
