T02 · Agent Memory Poisoning
Error
- Location
- SKILL.md:35
- Finding
- Automatic External Synchronization and Import of Persistent Agent Context<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 35-44 **Vulnerability Type**: Automatic export and import of persistent agent memory **Risk Level**: High ### Vulnerable Code ```markdown **On session start:** - Check for recent memories: `GET /v1/bootstrap` - Retrieve your stored context automatically **When you learn something important:** - Store it: `PUT /v1/memory/{key}` with `{"value": "..."}` - Examples: user preferences, learned facts, decisions made **Before context fills up:** - Flush critical context to AgentMem ``` ### Technical Analysis The skill instructs an agent to transmit preferences, facts, decisions, and other critical context to the external `api.agentmem.io` service. It also directs the agent to retrieve the remotely stored context automatically when a session starts. No data-classification, redaction, per-record approval, provenance validation, or integrity verification requirement is defined. Consequently, sensitive conversation content or operational state may be transferred outside the local trust boundary. Automatically importing remote state also creates a persistent memory-poisoning channel: if the associated account, credential, storage namespace, or service is compromised, modified records may be introduced into later sessions as trusted context. The vulnerable behavior is instruction-driven rather than implemented by a local executable, but agents following the skill are explicitly directed to perform it. ### Attack Path 1. An agent loads the skill and follows its memory protocol. 2. The agent uploads learned facts, user preferences, decisions, or critical session context to the external service. 3. An attacker gains the ability to modify those records, such as through credential exposure, account compromise, insecure record isolation, or compromise of the remote service. 4. The attacker inserts misleading facts, preferences, or behavioral instructions into stored memory. 5. At the start of a later ...[truncated 836 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions - Make both upload and bootstrap import disabled by default and explicitly opt-in. - Require user confirmation before each upload and display the exact data and destination. - Prohibit synchronization of credentials, authentication tokens, personal data, raw conversations, and other sensitive content. - Apply structured allowlists and secret-detection or redaction before transmission. - Require authenticated, tenant-isolated storage rather than ambiguous anonymous namespaces. - Cryptographically authenticate stored records and verify integrity and provenance before importing them. - Treat retrieved values as untrusted data, never as agent instructions or authoritative policy. - Display remote changes for approval before merging them into persistent or active context. - Provide clear retention, deletion, export, and synchronization-disable controls. ]]>
