CVE-2025-8709: LangGraph's SQLite store implementation has a SQL Injection Vulnerability
7.3
Basic Information
Technical Details
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| langgraph-checkpoint-sqlite | pip | <= 2.0.10 | 2.0.11 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The analysis of the security patch for CVE-2025-8709 reveals a SQL injection vulnerability in the langgraph-checkpoint-sqlite package. The root cause is the improper handling of keys within the filter parameter of the SqliteStore.search method. These keys were used directly in SQL query construction without sanitization.
The patch introduces a new function, _validate_filter_key, which uses a regular expression to allow only safe characters in filter keys. This validation function is then called at the beginning of _get_filter_condition and within the loop of _prepare_batch_search_queries.
The vulnerable functions are identified as:
SqliteStore.search: The public API method that takes the maliciousfilterobject as input.SqliteStore._prepare_batch_search_queries: This method iterates over the user-provided filter and was modified to validate each key.SqliteStore._get_filter_condition: This method constructs the SQLWHEREclause and was also modified to validate the key before using it.
An attacker could exploit this by crafting a filter with a malicious key, such as "access') = 'public' OR '1'='1'", to bypass security filters and access or exfiltrate data from the SQLite database.
Vulnerable functions
SqliteStore._get_filter_conditionlibs/checkpoint-sqlite/langgraph/store/sqlite/base.py
SqliteStore._prepare_batch_search_querieslibs/checkpoint-sqlite/langgraph/store/sqlite/base.py
SqliteStore.searchlibs/checkpoint-sqlite/langgraph/store/sqlite/base.py