VAITP Dataset

← Back to the dataset

CVE-2026-114510

Cypher injection via unsafe string escaping in Flexible GraphRAG 0.6.0–0.8.2.

  • CVSS 7.1
  • CWE-116
  • Input Validation and Sanitization
  • Remote

Flexible GraphRAG is a Python framework for building graph and retrieval-augmented generation applications across multiple graph, vector, and search backends. From 0.6.0 until 0.8.2, the _escape() helper in flexible-graphrag/langchain/graph/pg_store_adapters/falkordb_adapter.py escapes quotes before backslashes and then interpolates the result into Cypher assembled by FalkorDBAdapter.add_graph_documents, allowing an inserted escape to be doubled and a quote to terminate the string early. When GRAPH_BACKEND=langchain and GRAPH_DB=falkordb are configured, attacker-influenced ingested document content can cause the extraction model to produce malicious entity or relationship values that reach these queries, allowing injected Cypher clauses to modify or delete graph data and, when the calling code surfaces query results to the user or LLM, disclose graph data. Dynamic node and relationship type identifiers are also inserted into backtick-quoted query positions without safe parameterization. The LlamaIndex FalkorDB store is not affected. This issue is fixed in version 0.8.2.

CVSS base score
7.1
Published
2026-10-22
OWASP
A03 Injection
Orthogonal defect classification
Interface
Code defect classification
Incorrect Interface
Category
Input Validation and Sanitization
Subcategory
Command Injection
Accessibility scope
Remote
Impact
Information Disclosure
Affected component
flexible-graphrag
Fixed by upgrading
Yes

Solution

Upgrade Flexible GraphRAG to version 0.8.2 or later.

Vulnerable code sample

import re

class FalkorDBAdapter:
    def __init__(self, db):
        self.db = db

    def _escape(self, value: str) -> str:
        # VULNERABLE: escapes quotes before backslashes, allowing double‑escaping attacks
        return value.replace('"', '\\"').replace('\\', '\\\\')

    def add_graph_documents(self, documents):
        queries = []
        for doc in documents:
            node_label = self._escape(doc["label"])
            node_props = self._escape(doc["properties"])
            # Assemble Cypher string with interpolated, insufficiently escaped values
            query = f'CREATE (n:{node_label} {{props: "{node_props}"}})'
            queries.append(query)
        for q in queries:
            self.db.execute(q)

Patched code sample

import re

class FalkorDBAdapter:
    def __init__(self, db):
        self.db = db

    def _escape(self, value: str) -> str:
        # FIX: escape backslashes before quotes to prevent double‑escaping
        return value.replace('\\', '\\\\').replace('"', '\\"')

    def add_graph_documents(self, documents):
        queries = []
        for doc in documents:
            node_label = self._escape(doc["label"])
            node_props = self._escape(doc["properties"])
            query = f'CREATE (n:{node_label} {{props: "{node_props}"}})'
            queries.append(query)
        for q in queries:
            self.db.execute(q)

Published fix

Public sources link this CVE to the changes below. The code samples above were generated to illustrate the defect; these links lead to the code the project actually changed.

  • v0.8.2: new kg-spaces-aca shares Angular UI npm lib, process tab rows show if already synced/ingested, no duplicate ingests, FalkorDB security fix (stevereiner/flexible-graphrag)
    flexible-graphrag/backend.py · FlexibleGraphRAGBackend._ingest_via_flow, flexible-graphrag/backend.py · FlexibleGraphRAGBackend._process_documents_async, flexible-graphrag/cocoindex_integration/connectors/flexible/_file.py, flexible-graphrag/cocoindex_integration/connectors/flexible/_file.py · FlexibleFile.__init__, flexible-graphrag/flow_service.py, flexible-graphrag/flow_service.py · FlowService.run_ingestion_flow, flexible-graphrag/flow_service.py · redact_config_for_log, flexible-graphrag/incremental_system.py, flexible-graphrag/incremental_system.py · IncrementalSystemManager.add_datasource_for_sync, flexible-graphrag/incremental_updates/config_manager.py, flexible-graphrag/incremental_updates/config_manager.py · ConfigManager.create_config, flexible-graphrag/incremental_updates/config_manager.py · ConfigManager._create_schema and 30 more

Cite this entry

@misc{vaitp:cve2026114510,
  title        = {{Cypher injection via unsafe string escaping in Flexible GraphRAG 0.6.0–0.8.2.}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2026},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2026-114510},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-114510/}}
}

Download this entry as JSON Download the whole dataset

Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.

The supreme art of war is to subdue the enemy without fighting.

Sun Tzu – “The Art of War”

:: Shaping the future through research and ingenuity ::

Before you use the VAITP AI models

Please read and accept the following disclaimer:

By choosing "I understand and accept", you acknowledge that you understand and agree to these terms.