# CVE-2026-91934: Flowise before 3.1.4 Remote Code Execution via SQL Database Chain

The Markdown version of <https://upatch.dev/cve/CVE-2026-91934>. Last updated 25 Nov 2026.

## At a glance

CVE-2026-91934 is rated High 8.7 (CVSS 4.0, 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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X). It affects Flowise (FlowiseAI) and was published on 15 Sept 2026. It is not in CISA's Known Exploited Vulnerabilities catalog. Its EPSS score is 0.7%: the estimated chance it is exploited in the next 30 days, as of 24 Nov 2026. The upatch `cve-2026-91934-file-block` mitigates it, and is vetted (merged into the registry).

A upatch is a signed BPF program that shirudo loads into a running Linux kernel to block the code path this CVE's exploit takes. It holds the line until the fix ships; it does not replace patching.

## The vulnerability

CVE-2026-91934 (GHSA-pwfj-wh95-7mwp), published on 15 September 2026, affects Flowise (`flowise` and `flowise-components` npm packages) before 3.1.4. In `packages/components/nodes/chains/SqlDatabaseChain/SqlDatabaseChain.ts`, `getSQLDBChain` accepts a user-supplied SQLite file path (`url`) and passes it to TypeORM's `DataSource` (or, in 3.1.3, validates only the initial path while still allowing arbitrary SQL statements on the SQLite connection). An authenticated user who configures or runs a Chatflow with a `Sql Database Chain` node can make Flowise create a new SQLite database file at an arbitrary path: in `/etc/chromium/*.conf` (sourced as a shell script by the Chromium launcher when Puppeteer runs) for remote code execution, or in `flowise-ui/build/` for stored XSS.

### Official description

Flowise versions before 3.1.4 fail to validate file paths in the SQL Database Chain node when connecting to SQLite databases, allowing authenticated attackers to write arbitrary files. Attackers can write malicious SQLite databases to system directories or inject files into the web root to execute commands or perform stored XSS attacks.

## What the upatch does

One BPF LSM program returns `-EPERM` to processes whose executable is named `node`:

| Hook               | Refused                                                              |
| ------------------ | -------------------------------------------------------------------- |
| `lsm/inode_create` | Creating a file directly inside `etc/chromium` or `flowise-ui/build` |

The program checks the parent directory's name and its parent's name first (`etc/chromium` or `flowise-ui/build`), and only when one matches checks whether the current task's executable is `node`. A refusal from an earlier BPF LSM program on the same hook is passed on.

The `refused` per-CPU array counts refusals at key 0.

The policy: [`cve-2026-91934-file-block.bpf.c`](https://github.com/copper-helm/upatch-registry/tree/main/upatches/cve-2026-91934), 87 lines of BPF C attached at `lsm/inode_create`, licensed GPL-2.0 OR BSD-2-Clause.

## Side effects

- A `node` process cannot create new files directly in `/etc/chromium` or in `flowise-ui/build` at runtime. Flowise never writes to `/etc/chromium`, and `flowise-ui/build` contains static frontend assets built at package publish time.
- Package managers or build scripts that invoke `node` to build or unpack files directly into `flowise-ui/build` while the upatch is loaded will receive `EPERM`; `npm install` extracts tarballs without creating files in `/etc/chromium`, though installing `flowise-ui` while the upatch is loaded may be blocked if `node` creates files in `flowise-ui/build`.
- Not covered: writes to other directories on the filesystem, or overwriting an existing file in `/etc/chromium` or `flowise-ui/build` without creating a new inode.

## Preemption model and cost

The program keeps no state beyond the per-CPU refusal counter, which it updates with an atomic add (`__sync_fetch_and_add`), so it is safe under every preemption model, including `PREEMPT_LAZY`, preemptible RCU and `PREEMPT_RT`. On every `inode_create` outside directories named `chromium` or `build`, a run costs one comparison of the parent dentry's `d_name.len`.

## Affected versions

Application vulnerability: `flowise` and `flowise-components` versions through 3.1.3 are affected; version 3.1.4 fixes the issue by restricting SQLite paths with `validateSQLitePath` and restricting SQLite queries in `getSQLDBChain` with `assertReadOnlySqlStatement`.

Kernels: the program uses the `inode_create` LSM hook prototype that takes `const struct mnt_idmap *idmap` as its first argument, as Linux 7.4 and current mainline do.

## How it was tested

On Flowise 3.1.2 (flowise-components 3.1.2 on Node.js 20.19.0), the loaded upatch refused the SqlDatabaseChain SQLite file creation in /etc/chromium while loaded, and allowed it before loading and after unloading.

- **Tested:** 25 Nov 2026
- **Target:** Flowise 3.1.2 (flowise-components 3.1.2) on Node.js 20.19.0, SqlDatabaseChain node with SQLite, loopback only
- **Kernel:** 7.4-shirudo-ci-20261123
- **Architecture:** x86_64
- **Distribution:** Ubuntu 26.04

### Results

| State           | SqlDatabaseChain creates SQLite file in /etc/chromium |
| --------------- | ----------------------------------------------------- |
| Before loading  | yes (HTTP 200)                                        |
| Upatch loaded   | no (HTTP 500)                                         |
| After unloading | yes (HTTP 200)                                        |

## How to apply

Build the upatch from source, sign it with your own shirudo key, and publish it to your own OCI registry. Machines that follow your upatch tree load it within about a minute.

Build and sign:

```sh
git clone https://github.com/copper-helm/upatch-registry
cd upatch-registry
tools/build <shirudo-checkout> <keys-dir> 1.0.0 upatches/cve-2026-91934
```

Publish and roll out:

```sh
shirudo bpm push build/packages/cve-2026-91934-1.0.0.bee oci://<registry>/<namespace>/cve-2026-91934 --keys-dir <keys-dir>
shirudo bpm tree append build/packages/cve-2026-91934-1.0.0.bee oci://<registry>/<namespace>/<tree> --tree-id <tree-id> --keys-dir <keys-dir>
```

## Review

- Contributors: romanlab.
- Reviewers: none recorded yet.

## Sources and links

- [CVE-2026-91934 record (CVE API)](https://cveawg.mitre.org/api/cve/CVE-2026-91934)
- [GitHub Security Advisory GHSA-pwfj-wh95-7mwp](https://github.com/FlowiseAI/Flowise/security/advisories/GHSA-pwfj-wh95-7mwp)
- [VulnCheck advisory](https://www.vulncheck.com/advisories/flowise-before-3.1.4-remote-code-execution-via-sql-database-chain)
- Fix commits: [d07186844263](https://github.com/FlowiseAI/Flowise/commit/d07186844263bad057008863037466aff7c3390f), [4ea391204a49](https://github.com/FlowiseAI/Flowise/commit/4ea391204a499fb6d19747104502362295b4dde3), release [flowise@3.1.4 (a65f81bb43ef)](https://github.com/FlowiseAI/Flowise/commit/a65f81bb43ef66d3ce734bf0dff4223ae8041c95)

### Links

- [CVE-2026-91934 on upatch.dev](https://upatch.dev/cve/CVE-2026-91934) (this page, as HTML)
- [NVD](https://nvd.nist.gov/vuln/detail/CVE-2026-91934)
- [CVE.org](https://www.cve.org/CVERecord?id=CVE-2026-91934)
- [CWE-22](https://cwe.mitre.org/data/definitions/22.html)
- Upatch source: [upatches/cve-2026-91934](https://github.com/copper-helm/upatch-registry/tree/main/upatches/cve-2026-91934)

### More references from NVD (2)

- [github.com](https://github.com/FlowiseAI/Flowise/security/advisories/GHSA-pwfj-wh95-7mwp)
- [vulncheck.com](https://www.vulncheck.com/advisories/flowise-before-3.1.4-remote-code-execution-via-sql-database-chain)
