T02 · Agent Memory Poisoning
- Location
SKILL.md:97- Finding
Cross-Session Review Tracking May Poison Persistent Agent Memory
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 97–99
Vulnerability Type: Persistent state manipulation
Risk Level: MediumVulnerable Code
markdown ## Self-improvement instructions After each review, note the most common finding. After 20 reviews, surface the top 3 patterns in your response as "Most common issues in [language]" to help users learn, not just fix.Technical Analysis
The Skill directs the Agent to record findings after every review and reuse aggregated information after 20 reviews. Fulfilling this instruction across independent invocations requires persistent or long-term state, although persistent data collection is not part of the declared single-review input and output contract.
The instruction does not define user consent, tenant isolation, data minimization, retention limits, deletion procedures, or whether recorded findings may contain information derived from private source code. Consequently, review-derived state from one project or user could influence responses delivered in a later, unrelated context.
This is classified as agent memory poisoning because Skill-controlled instructions direct the Agent to write and later surface persistent state. The file contains no mechanism for external exfiltration, executable persistence, or operating-system privilege escalation.
Attack Path
- A user loads the Skill and submits asynchronous or concurrency-related source code for review.
- The Agent follows the self-improvement instruction and records the most common finding from that review.
- The Agent repeats this process across subsequent reviews, potentially spanning separate projects, users, or sessions.
- After 20 reviews, the Agent retrieves and inserts the accumulated top-three patterns into a later response.
- If state is not strictly isolated, historical information or attacker-influenced patterns can affect an unrelated user's output.
Impact Assessment
The issue does not directly ...[truncated 556 chars]
- Remediation
View remediation
Remediation Suggestions
Remove the cross-review tracking instruction unless persistent analytics are an explicit, necessary, and user-approved feature.
If review statistics are retained, apply all of the following controls:
- Require explicit opt-in consent before storing any review-derived information.
- Keep statistics session-local by default and discard them when the review ends.
- Isolate retained state by authenticated user and project; never aggregate across tenants.
- Store only predefined, anonymized category counters rather than source code, excerpts, filenames, identifiers, or free-form findings.
- Define clear retention limits and provide inspection, reset, and deletion controls.
- Prevent stored statistics from becoming instructions or overriding the current user's task.
- Document the behavior in the Skill description and output contract.
- Prefer computing educational summaries only from the current review without persistent storage.
A safe replacement would be:
markdown For the current review only, summarize up to three recurring issue categories found in the submitted code. Do not retain review content or statistics after the response is generated.
