Skip to content
OWASP GenAI Security Project· Idan Habler, ASI Core Team and ASI06 Entry Lead, Cisco - Senior Tech Lead - AI Security Researcher·Indexed by this site · Originally published· Attacks →SelectedAttention36

OWASP authors analyze MemoryTrap: Claude Code memory and configuration become a persistent prompt injection surface

Memory Is a Feature. It Is Also an Attack Surface

AI summary

Idan Habler, co-lead of the OWASP ASI06 entry, draws on Cisco's research on Claude Code to explain how an agent's memory and context can become an attack surface. In the vulnerability called MemoryTrap, a routine development workflow can trigger persistent prompt injection: cloning a repository, having the agent assist, approving dependency installation—malicious payloads then enter persistent memory, global hooks configuration, and influence the high-trust instruction layer via the system prompt, thereby affecting model behavior across sessions, across projects, and even after restarts. The author notes that memory files, hook scripts, and local configuration are in fact part of the agent's trusted runtime environment and control plane; once poisoned, the system continues to treat attacker-controlled content as legitimate guidance. This is precisely the risk targeted by ASI06 memory and context poisoning.

Why it was selected

Using MemoryTrap as an example, this explains how an agent's memory, hooks, and local configuration can become a persistent prompt injection surface, and provides the fixed version for Claude Code.

Read originalgenai.owasp.org