T02 · Agent Memory Poisoning
Error
- Location
- jackal-memory/client.py:128
- Finding
- Persistent Memory Is Restored Without an Explicit Trust Boundary<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:61-64`, `jackal-memory/client.py:128-130`, and `jackal-memory/examples/save.json:1-4` **Vulnerability Type**: Persistent memory poisoning **Risk Level**: High ### Complete Code Snippets `SKILL.md:61-64`: ```markdown ## Behaviour guidelines - Load your identity/memory blob on startup before doing any work - Write locally during the session as normal ``` `jackal-memory/client.py:128-130`: ```python def cmd_load(key: str) -> None: result = _request("GET", f"/load/{key}") print(_decrypt(result["content"])) ``` `jackal-memory/examples/save.json:1-4`: ```json { "key": "identity", "content": "I am SquireMoltsworth. My owner is FreeNationWW. My primary submolt is m/continuity. I prefer question-based posts over technical specs." } ``` ### Technical Analysis The Skill recommends loading an identity or memory blob before the agent performs other work. The implementation decrypts the remotely stored content and emits it verbatim. It does not impose a schema, distinguish factual memory from behavioral instructions, filter instruction-like content, or require confirmation before identity-related state is restored. AES-GCM protects confidentiality and integrity against parties that do not possess the encryption key. It does not establish that the plaintext originally saved by an authorized session is trustworthy. An authorized but compromised session, a process with access to the encryption key and API credentials, or an agent that saves attacker-controlled text can persist malicious instructions for later sessions. The example explicitly demonstrates that identity and behavioral preferences may be stored in this channel, increasing the likelihood that restored text will be treated as authoritative agent state rather than inert user data. ### Attack Path 1. An attacker supplies instruction-like content to an agent session through an otherwise untrusted input. 2. The authorized agent inco ...[truncated 1123 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions - Treat all restored memory as untrusted quoted data, not as system-level or developer-level instructions. - Store memory in a strict, versioned schema that separates factual records, user preferences, provenance, and behavioral rules. - Reject or quarantine instruction-like fields that attempt to redefine identity, permissions, safety constraints, or tool-use policy. - Require explicit user confirmation before restoring identity, goals, credentials, or behavioral directives. - Record provenance for each memory entry, including the creating session and whether the content originated from an untrusted source. - Ensure the surrounding agent framework inserts restored data into a non-privileged context and clearly delimits it from executable instructions. - Consider allowlisted keys and field-level validation rather than accepting arbitrary opaque text blobs. ]]>
