Impact
The vulnerability resides in the _escape() helper of flexible-graphrag, which incorrectly escapes quotes before backslashes, causing injected strings to terminate early. This leads to Cypher injection where attacker-controlled document content can be turned into executable Cypher clauses. The injected clauses can modify or delete graph objects and expose data if query results are returned to users or LLMs. The weakness is an instance of broken string escaping and unsafe query construction.
Affected Systems
The issue affects stevereiner flexible-graphrag versions 0.6.0 through 0.8.2 when configured with GRAPH_BACKEND=langchain and GRAPH_DB=falkordb. The LlamaIndex FalkorDB store is not affected. Any deployment using the falkordb_adapter.py component in the vulnerable version range is at risk.
Risk and Exploitability
With a CVSS score of 7.1, the vulnerability presents moderate to high severity. No EPSS data is available, and it is not listed in the KEV catalog. Attackers who can influence the content of ingested documents—potentially via external data feeds or API calls—can exploit the injection flaw. The attack vector is inferred to be remote or local through data ingestion channels; the exploit requires the ability to supply document content that contains malicious Cypher. Successful exploitation could result in data loss, unauthorized modification, and disclosure of graph data.
OpenCVE Enrichment