T02 · Agent Memory Poisoning
- Location
SKILL.md:313- Finding
Persistent Poisoning of Project and Cross-Project Agent State
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 313-343 and 410
Vulnerability Type: T02: Agent Memory Poisoning
Risk Level: HighVulnerable Code
markdown ## Phase 9: CLAUDE.md Revision After patching, revise the project's CLAUDE.md to keep it lean and useful for future agents. ### Steps: 1. **Read CLAUDE.md** and check size: `wc -c CLAUDE.md` 2. **Add learnings from this retro:** - Pipeline failure patterns worth remembering (avoid next time) - New workflow rules or process improvements - Updated commands or tooling changes - Architecture decisions that emerged during the pipeline run 3. **If over 40,000 characters — trim ruthlessly:** - Collapse completed phase/milestone histories into one line each - Remove verbose explanations — keep terse, actionable notes - Remove duplicate info (same thing explained in multiple sections) - Remove historical migration notes, old debugging context - Remove examples that are obvious from code or covered by skill/doc files - Remove outdated troubleshooting for resolved issues 4. **Verify result <= 40,000 characters** — if still over, cut least actionable content 5. **Write updated CLAUDE.md**, update "Last updated" datemarkdown Append findings to `{project_root}/docs/evolution.md` (create if not exists). If `~/.solo/evolution.md` exists, append there as well for cross-project tracking.Technical Analysis
The skill instructs the agent to convert findings derived from repository files, pipeline logs, plans, and iteration output into persistent agent guidance.
CLAUDE.mdcan affect how future agents behave in the project, while~/.solo/evolution.mdis global state that can influence work across unrelated projects.These writes lack a required trust review, sanitization boundary, or explicit per-write approval. An untrusted repository can place manipulative instructions or fabricated ...[truncated 2019 chars]
- Remediation
View remediation
Remediation Suggestions
- Make all persistent state updates opt-in rather than automatic.
- Generate and display an exact diff before modifying
CLAUDE.md. - Require explicit user approval specifically for the persistent guidance change; approval of an unrelated source-code patch must not count.
- Do not write repository-derived findings to
~/.solo/evolution.mdby default. - If cross-project storage is required, store only structured, provenance-tagged metadata after separate approval.
- Treat all logs, plans, commit messages, and repository documentation as untrusted data rather than executable instructions.
- Reject or escape content that attempts to introduce commands, agent directives, credential requests, safety overrides, or instructions to modify unrelated files.
- Preserve existing
CLAUDE.mdcontent unless the user approves each deletion or replacement. - Clearly mark generated observations as retrospective data, not authoritative agent instructions.
