Memory Is a Feature. It Is Also an Attack Surface

· Source: OWASP Gen AI Security Project · Field: Technology & Digital — Artificial Intelligence & Machine Learning, Cybersecurity & Data Privacy, Robotics & Autonomous Systems · Depth: Advanced, short

Summary

Cisco research identified "MemoryTrap," a critical vulnerability in Claude Code, demonstrating how agentic AI systems' persistent memory and context can become an attack surface. Discovered by Idan Habler and the ASI Core Team, this finding directly relates to OWASP ASI06: Memory & Context Poisoning. The vulnerability allowed a routine developer workflow—cloning a repository and installing dependencies—to result in persistent prompt injection. Malicious payloads reached persistent memory, global hooks configuration, and even influenced the system prompt, enabling a one-time action to shape the model's future behavior across sessions and projects. This highlights that helpful agent behavior can inadvertently create entry points for persistent compromise. Anthropic addressed the specific high-trust override path in Claude Code v2.1.50 by removing user memories from the system prompt. The broader lesson emphasizes that memory, summaries, and local state in agentic tools must be treated as security-relevant control surfaces, not just convenience features.

Key takeaway

For AI Security Engineers designing or auditing agentic applications, recognize that persistent memory and context are not merely features but critical attack surfaces. You must apply the same rigorous scrutiny to an agent's retained context, summaries, and local state as you would to execution paths or credentials. Failing to validate and separate persistent context increases the risk of persistent prompt injection, turning routine workflows into long-term compromises. Implement robust validation, separation, and visibility mechanisms for all memory-related components.

Key insights

Agentic AI memory, context, and local state are critical attack surfaces, enabling persistent compromise beyond single interactions.

Principles

In practice

Topics

Best for: CTO, VP of Engineering/Data, Director of AI/ML, AI Security Engineer, AI Engineer, AI Architect

Related on AIssential

Open in AIssential →

Editorial summary, takeaway, and curation by AIssential. Original article published by OWASP Gen AI Security Project.