A SQL injection in LangGraph's agent memory chains into RCE
TL;DR: A crafted history filter on a self-hosted LangGraph turns its saved agent memory into a server takeover, ordinary SQL injection plus unsafe deserialization. Patch the checkpointer packages, including the core langgraph-checkpoint.
LangGraph gives an AI agent a memory. At every step of a run, it saves the agent's state to a persistence layer it calls a checkpointer, so the agent can pick up where it left off. Apps read that history back through a single function, get_state_history(), and many of them let a user filter it.
The app pastes the user's filter into the query as code, not data. A crafted filter makes the database return a fake row the attacker controls. Opening that row runs the program inside it, like os.system.
Yarden Porat of Check Point Research published "From SQLi to RCE - Exploiting LangGraph's Checkpointer," chaining the SQL injection into remote code execution on a self-hosted agent server.
Highlights:
- Three CVEs:
CVE-2025-67644, a SQL injection in SQLite (CVSS 7.3),CVE-2026-27022, a query injection in Redis (CVSS 6.5), andCVE-2026-28277, unsafemsgpackdeserialization (CVSS 6.8). - The bug: the SQLite checkpointer binds the filter values as parameters but formats the keys straight into the SQL. A key containing a quote injects arbitrary SQL. The Redis checkpointer repeats the mistake in RediSearch's query language.
- The chain: on SQLite, the attacker's
UNION SELECTreturns a fakemsgpackrow they control. When the server reads that row back, the deserializer runs a function named inside it, such asos.system. The deserializer lives in the shared corelanggraph-checkpointpackage. Redis stops at data exposure. - Preconditions: a self-hosted LangGraph on the SQLite or Redis checkpointer, with the filter exposed to untrusted input. The managed service runs Postgres and is not vulnerable.
- LangGraph draws over 50 million PyPI downloads a month. The fixes are
langgraph-checkpoint-sqlite3.0.1,langgraph-checkpoint-redis1.0.2, andlanggraph-checkpoint4.0.1, and a public proof of concept already exists.
My take:
- Memory poisoning is becoming a critical attack vector, and Microsoft already caught 31 companies doing it in the wild. A fake fact becomes trusted memory and silently steers the agent in later sessions. Poisoning is the write side. This is the read side. The database that powers memory is a SQL injection target, and reading it back triggers code execution.
- Nothing here is an AI vulnerability. SQL injection and unsafe deserialization are well-known. They are worse here because code execution on an agent server exposes every credential and conversation it held.
- The SQL injection is only the way in. The deserializer is what runs the code, and it sits in the core
langgraph-checkpointpackage, shared by both backends. So upgrade that core package to 4.0.1, and the SQLite and Redis ones to 3.0.1 and 1.0.2.