The vulnerability is a SQL injection within the SqliteStore component of the langgraph-checkpoint-sqlite package. The root cause is the improper handling of user-supplied keys in the filter argument of the search method. These keys are directly concatenated into a SQL query string without sanitization, allowing an attacker to inject arbitrary SQL.
The analysis of the provided patch bc9d45b476101e441cb1cc602dea03eb29232de4 confirms this. The patch introduces a new function, _validate_filter_key, which validates that filter keys contain only safe characters. This validation function is then called in the _prepare_batch_search_queries and _get_filter_condition methods before the keys are used, proving that these were the points where the injection occurred.
The SqliteStore.search method is the public entry point for the vulnerability, as shown in the Proof of Concept. During an exploit, a runtime profiler would show a call to SqliteStore.search, which then calls the internal methods _prepare_batch_search_queries and _get_filter_condition where the malicious SQL is constructed. Therefore, all three functions are key indicators of this vulnerability being triggered.
SqliteStore.searchlibs/checkpoint-sqlite/langgraph/store/sqlite/base.py
SqliteStore._prepare_batch_search_querieslibs/checkpoint-sqlite/langgraph/store/sqlite/base.py
SqliteStore._get_filter_conditionlibs/checkpoint-sqlite/langgraph/store/sqlite/base.py
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| langgraph-checkpoint-sqlite | pip | <= 2.0.10 | 2.0.11 |
Ongoing coverage of React2Shell