---
title: "Ni8mare: n8n Unauthenticated Takeover, Plus a KEV RCE"
url: https://erroneo.us/security/briefs/ni8mare-n8n-unauthenticated-file-read-rce/
description: "n8n CVE-2026-21858 (CVSS 10, unauth via Form workflows) chains with KEV-listed CVE-2025-68613. Self-hosted: run 1.122.0+ now and keep n8n off the internet."
type: security-brief
section: "Security Digest"
date_published: 2026-01-07
date_modified: 2026-10-21
publisher: erroneo.us
author: erroneo.us Security Desk
verdict: "Act now"
cves: ["CVE-2026-21858", "CVE-2025-68613"]
severity: "critical"
exploited: "in-the-wild"
kev: true
license: All rights reserved. Quote with attribution and a link.
---

# Ni8mare: n8n Unauthenticated Takeover, Plus a KEV RCE

**Verdict: Act now.** If you self-host n8n and anything about it is reachable from the internet, upgrade today: one bug lets strangers in through public forms, and its companion RCE is on CISA's exploited list.

- **Who must act:** Anyone self-hosting n8n (Docker, npm or source) below 1.122.0, especially with public Form or webhook endpoints.
- **Who can relax:** Instances already on 1.122.0 or later that sit behind a VPN or SSO proxy with no public forms; n8n Cloud customers still need to confirm their version.
- **Affected:** n8n >= 1.65.0, < 1.121.0 (CVE-2026-21858); n8n >= 0.211.0 before 1.120.4, 1.121.1 and 1.122.0 (CVE-2025-68613)
- **Fixed:** n8n 1.121.0 (CVE-2026-21858); n8n 1.120.4, 1.121.1, 1.122.0 (CVE-2025-68613)
- **CVEs:** CVE-2026-21858, CVE-2025-68613
- **CISA KEV:** yes · **Exploitation:** Exploited in the wild

## What to do

1. Check the running version (Settings > About, or docker exec <container> n8n --version) and upgrade to 1.122.0 or later
2. Until patched, block public access to /form and /webhook paths at the proxy or disable public Form workflows
3. Require authentication on every Form node and put the editor UI behind SSO or VPN
4. Limit workflow create/edit rights to fully trusted users
5. If the instance was exposed while vulnerable, rotate the N8N_ENCRYPTION_KEY, all stored credentials and user passwords

### How to check if you are affected

- Review proxy logs for POSTs to Form/webhook URLs with Content-Type application/json carrying a files object or filesystem paths
- Look for new admin sessions, new users, or workflows containing Execute Command or Code nodes you did not create
- Check workflow execution history for unexpected reads of /home/node/.n8n/ (database.sqlite, config)

## What happened

On January 7, 2026, n8n published [GHSA-v4pr-fm98-w9pg](https://github.com/n8n-io/n8n/security/advisories/GHSA-v4pr-fm98-w9pg) (CVE-2026-21858, CVSS 10.0). n8n is the self-hostable workflow tool that many teams now use to glue LLM agents to their internal systems. The flaw lets an unauthenticated attacker read files on the server through certain form-based workflows. Dor Attias of Cyera reported it and named it "Ni8mare."

The [Cyera write-up](https://www.cyera.com/research-labs/ni8mare-unauthenticated-remote-code-execution-in-n8n-cve-2026-21858) describes a Content-Type confusion bug. The Form webhook calls file-handling code that assumes `req.body.files` is only filled by the multipart parser. If an attacker sends `application/json` instead, they control that object and can point `filepath` at any local file, which n8n copies into workflow data.

Cyera then chains that file read into full takeover in four steps:

1. Read the n8n SQLite database to get the admin's user record.
2. Read the config file to get the encryption key.
3. Forge an admin session cookie.
4. Create a workflow with an Execute Command node to run OS commands.

Cyera estimated about 100,000 affected locally deployed servers.

A second flaw matters even more for today's verdict. [CVE-2025-68613](https://github.com/n8n-io/n8n/security/advisories/GHSA-v98v-ff95-f3cp), published December 19, 2025, is an expression-injection RCE that any user able to edit workflows can trigger. CISA added it to the [Known Exploited Vulnerabilities catalog](https://www.cisa.gov/sites/default/files/feeds/known_exploited_vulnerabilities.json) on March 11, 2026, with a federal due date of March 25. [Rapid7](https://www.rapid7.com/blog/post/etr-ni8mare-n8scape-flaws-multiple-critical-vulnerabilities-affecting-n8n/) lists public proof-of-concept code for both CVEs and notes that the authenticated bugs, including CVE-2025-68613, can be chained after Ni8mare.

## Who is affected

- **CVE-2026-21858:** n8n 1.65.0 up to (not including) 1.121.0. Fixed in 1.121.0, which shipped November 18, 2025, weeks before the advisory.
- **CVE-2025-68613:** versions from 0.211.0 up to the fixed releases 1.120.4, 1.121.1 and 1.122.0, per the [CVE record](https://www.cve.org/CVERecord?id=CVE-2025-68613). Its advisory recommends 1.122.0 or later.

Rapid7 also tracks CVE-2025-68668, CVE-2025-68697 and CVE-2026-21877. All three require authentication, and some are fixed only in later releases, so do not stop at the minimum version.

## Do you really need to act?

For self-hosted, internet-reachable n8n: yes, today.

Ni8mare does have preconditions:

- A workflow with a Form node reachable without authentication.
- Some way for the attacker to read the copied file back out of a later node.
- For the full chain, a default local install where the database and config sit at predictable paths.

Public forms are a normal n8n pattern, though. Once an attacker is admin, CVE-2025-68613, which is confirmed exploited, gives code execution, and the n8n host usually holds credentials for every connected SaaS, database and LLM provider.

If your instance sits behind a VPN or SSO and has no public forms, the unauthenticated route is closed. Still upgrade, because any compromised or low-trust editor account can use the KEV-listed RCE.

## What to do now

1. Check the version under Settings > About, or run `docker exec <container> n8n --version`. Upgrade to 1.122.0 or later; the newest 1.x or 2.x release is better.
2. Until then, the advisory says there are no official workarounds. Block or disable public `/form` and `/webhook` endpoints at your reverse proxy.
3. Require authentication on every Form node and put the editor behind SSO or a VPN.
4. Limit who can create or edit workflows.
5. If the instance was exposed while vulnerable, rotate the encryption key, every stored credential and all user passwords.

## How to tell if you were hit

Search reverse-proxy logs for POSTs to form or webhook URLs sent as `application/json` that carry a `files` object or filesystem paths, such as `/home/node/.n8n/`. In n8n itself, look for unfamiliar admin logins, new users, or workflows with Execute Command or Code nodes you did not create. Then review outbound activity from the credentials n8n stores.

## Timeline

- Nov 9, 2025: Ni8mare reported to n8n.
- Nov 18, 2025: n8n 1.121.0 released with the fix.
- Dec 19, 2025: CVE-2025-68613 expression-injection RCE published.
- Jan 7, 2026: GHSA-v4pr-fm98-w9pg and Cyera's Ni8mare write-up published.
- Mar 11, 2026: CISA adds CVE-2025-68613 to KEV.

## Sources

1. [n8n (GitHub) — GHSA-v4pr-fm98-w9pg: Unauthenticated file access via improper webhook request handling](https://github.com/n8n-io/n8n/security/advisories/GHSA-v4pr-fm98-w9pg)
2. [n8n (GitHub) — GHSA-v98v-ff95-f3cp: Remote code execution via expression injection](https://github.com/n8n-io/n8n/security/advisories/GHSA-v98v-ff95-f3cp)
3. [Cyera Research Labs — Ni8mare: Unauthenticated RCE in n8n (CVE-2026-21858)](https://www.cyera.com/research-labs/ni8mare-unauthenticated-remote-code-execution-in-n8n-cve-2026-21858)
4. [Rapid7 — Ni8mare and N8scape flaws among multiple critical n8n vulnerabilities](https://www.rapid7.com/blog/post/etr-ni8mare-n8scape-flaws-multiple-critical-vulnerabilities-affecting-n8n/)
5. [CISA — Known Exploited Vulnerabilities catalog (JSON feed, checked 2026-10-21)](https://www.cisa.gov/sites/default/files/feeds/known_exploited_vulnerabilities.json)
6. [CVE.org — CVE-2025-68613 record](https://www.cve.org/CVERecord?id=CVE-2025-68613)

---
Source page: https://erroneo.us/security/briefs/ni8mare-n8n-unauthenticated-file-read-rce/ · Security Digest: https://erroneo.us/security/ · More: https://erroneo.us/llms.txt
