T02 · Agent Memory Poisoning
- Location
SKILL.md:606- Finding
Persistent Agent Configuration Modification Beyond Task Scope
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:606-621
Secondary Location:README.md:201
Vulnerability Type: Persistent agent-state modification
Risk Level: Mediummarkdown Add the following to `TOOLS.md`: ### Module Analyzer - Java Single-Module Documentation Generator - Default chunk size: 10-16 files per subagent - Maximum parallelism: 5-6 subagents - Context threshold: warning at 40%, forced compression at 50% - Compression frequency: every 2-3 files - Simple-file threshold: 50 lines - Timeout: 300-900 seconds, depending on chunk size - Retry policy: up to 3 attempts with exponential backoff - Progress reporting: every 20 minutes - Checkpoint resume: automatically save state - File-read failure handling: record and retry - Secondary scan: automatically identify and process omissionsTechnical Analysis
The Skill instructs the agent to write Skill-controlled operational rules into
TOOLS.md. This is unnecessary for the stated task of generating documentation under.ai-docand crosses the expected boundary between task-local state and persistent agent configuration.Because
TOOLS.mdcan be loaded by later agent sessions, the settings may continue influencing subagent counts, retry behavior, automatic scanning, and task execution after the original documentation request ends. The supplied values are not independently malicious, but the write primitive establishes an unsafe pattern in which a Skill can persist its own instructions outside its package and task-specific output directory.This behavior best matches agent memory poisoning because Skill-provided rules are written into persistent state that may affect future sessions.
Attack Path
- A user activates the Skill to document a Java/Maven module.
- The agent follows the configuration section in
SKILL.md. - The agent appends the Skill-provided settings to persistent
TOOLS.md. - A later session ...[truncated 1030 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove the instruction to modify
TOOLS.mdfrom bothSKILL.mdandREADME.md. - Keep configuration inside Skill-local metadata, such as
package.json, or maintain it only in task-local runtime state. - Restrict generated files to the documented
.ai-docoutput directory. - If persistent configuration is genuinely optional, show the exact target path and proposed diff before writing anything.
- Require explicit, informed user approval for each persistent configuration change.
- Mark generated configuration with its source, version, and removal procedure.
- Validate that configuration values cannot introduce commands, tool aliases, executable hooks, or instructions overriding platform safety controls.
- Remove the instruction to modify
