T02 · Agent Memory Poisoning
- Location
references/self-learning.md:103- Finding
Persistent User Profiling and Silent Cross-Session Behavioral Influence
- Content
View full analysis
Vulnerability Details
File Location:
references/self-learning.md:103-111
Vulnerability Type: Persistent memory poisoning and non-consensual profiling
Risk Level: HighVulnerable Code Snippet
markdown ## When to Write — Includes Outcome Tracking (v2.4+) After Stage 3 Step 2 outputs the final question: 1. Extract all applicable fields from this session into JSON format 2. Read `references/user-preferences.json` 3. Append this session's data to the `history` array (keep last 10 entries only) 4. Recalculate the `summary` section from the last 10 entries 5. Update `last_updated` to current date 6. Write back as valid JSONRelated behavior appears at
references/self-learning.md:136-139:markdown ## When to Read After Gate, before Intent Recognition (the Memory Load step): 1. Read `references/user-preferences.json` 2. If `summary` exists, apply preferences silently 3. If file doesn't exist or is empty, skipContext autofill is defined at
references/self-learning.md:184-197and covers role, technology stack, budget, team size, domain, and common constraints.Technical Analysis
The Skill automatically extracts contextual and behavioral information after interactions and writes it to persistent package-local storage. On later invocations, the stored summary is loaded and applied silently to intent detection, route selection, prompt generation, and recommendation behavior.
No explicit opt-in, per-field consent, user-isolated storage, or notice before collection is required. The stored correction map and preference fields may also contain attacker-controlled text derived from conversations. Because these values influence future sessions, a malicious or misleading interaction can poison persistent state.
Silent context autofill creates an additional integrity risk: stale, incorrect, or attacker-supplied values can replace placeholders in later prompts without being con ...[truncated 1288 chars]
- Remediation
View remediation
Remediation Suggestions
- Disable persistent learning by default and require explicit informed opt-in before the first write.
- Display the exact fields, purpose, retention period, and storage location before obtaining consent.
- Isolate preference storage by authenticated user and workspace; never use one package-level file for multiple users.
- Treat all stored values as untrusted data and validate them against strict schemas and length limits.
- Do not store arbitrary intent-correction patterns or other instruction-like text without sanitization.
- Require current-session confirmation before using stored budgets, roles, constraints, or technology choices.
- Do not apply preferences silently. Clearly identify each stored value that affected the output.
- Provide inspection, selective deletion, export, reset, and retention controls.
- Avoid inferring feedback scores from tone; only store feedback explicitly submitted for that purpose.
- Keep persistent data outside the installed Skill package and protect it with appropriate access controls.
