LangGraph's SQLite store implementation contains SQL injection vulnerabilities using direct string concatenation without proper parameterization, allowing attackers to inject arbitrary SQL and bypass access controls.
/langgraph/libs/checkpoint-sqlite/langgraph/store/sqlite/base.py
The key portion of the JSON path is concatenated directly into the SQL string without sanitation. There's a few different occurrences within the file.
filter_conditions.append(
"json_extract(value, '$."
+ key # <-- Directly concatenated, no escaping!
+ "') = '"
+ value.replace("'", "''") # <-- Only value is escaped
+ "'"
)
This issue affects only developers or projects that directly use the checkpoint-sqlite store.
An application is vulnerable only if it:
SqliteStore from the checkpoint-sqlite package, andfilter argument using keys derived from untrusted or user-supplied input (such as query parameters, request bodies, or other external data).If filter keys are static or validated/allowlisted before being passed to the store, the risk does not apply.
Note: users of LangSmith deployments (previously known as LangGraph Platform) are not affected as those deployments rely on a different checkpointer implementation.
Complete instructions, including specific configuration details, to reproduce the vulnerability.
#!/usr/bin/env python3
"""Minimal SQLite Key Injection POC for LangGraph"""
from langgraph.store.sqlite import SqliteStore
# Create store with test data
with SqliteStore.from_conn_string(":memory:") as store:
store.setup()
# Add public and private documents
store.put(("docs",), "public", {"access": "public", "data": "public info"})...
2.0.11Exploitability
AV:LAC:LPR:LUI:NScope
S:CImpact
C:HI:LA:N7.3/CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:L/A:N