Written by Uptycs Threat Research | Jan 8, 2026, 5:00 PM UTC
Severity: Critical · Exploitation: No known exploitation · Fix available: Yes
Summary
A severe flaw dubbed Ni8mare (CVE-2026-21858) in the n8n workflow automation platform lets an unauthenticated attacker execute arbitrary code and fully compromise affected instances. Deployments exposed to untrusted networks or the public internet face a complete takeover risk. Because n8n often holds API keys, credentials, database connections and enterprise automation logic, a successful exploit has broad consequences for security and data protection. A related flaw, CVE-2026-21877, lets an authenticated user cause untrusted code to run through an arbitrary file write. Fixes are available for both.
Technical details
CVE-2026-21858 is caused by the way n8n parses certain webhook request content, specifically Content-Type handling in the middleware. Manipulated HTTP headers and request bodies (for example, forcing a Content-Type confusion) let an attacker control internal variables and bypass intended safeguards, so the platform's internal file-handling routines can be misused for arbitrary file access. No authentication is required: a remote attacker only needs to send crafted HTTP requests to n8n webhook endpoints.
CVE-2026-21877 requires an authenticated user. Under certain conditions that user can cause untrusted code to be executed by the n8n service through an arbitrary file write, which can fully compromise the instance. Both self-hosted and n8n Cloud instances are affected.
Affected products
- n8n (CVE-2026-21858) before 1.121.0 — fixed in 1.121.0
- n8n (CVE-2026-21877) after 0.123.0 and before 1.121.3 — fixed in 1.121.3
Impact
- Remote code execution. Successful exploitation runs code in the n8n host process.
- Credential theft. Stored API keys, credentials and database connections can be extracted.
- Workflow manipulation. Attackers can alter or abuse automation logic and the data it handles.
- Lateral movement. A compromised instance can be used to reach the services and systems it is connected to.
Exploitation status
No in-the-wild exploitation was reported at the time of disclosure. CVE-2026-21858 needs no authentication, so internet-exposed instances should be patched first.
Recommended actions
- Upgrade n8n to 1.121.3 or later, which fixes both CVE-2026-21858 (fixed in 1.121.0) and CVE-2026-21877 (fixed in 1.121.3).
- Remove n8n webhook endpoints from the public internet where they are not needed, or restrict access to trusted networks.
- Rotate credentials, API keys and database passwords stored in n8n if an instance was exposed while unpatched.
- Review workflows and recent changes for unexpected modifications.
How Uptycs helps
Uptycs vulnerability management identifies hosts, containers and cloud workloads running affected versions so teams can prioritize patching; search for the CVE IDs in the Vulnerabilities Dashboard. Uptycs Threat Research continues to monitor this vulnerability and will update this bulletin if exploitation activity changes.
-- CVE-2026-21858: n8n before 1.121.0
select * from npm_packages where name='n8n' and vercmp(version, '1.121.0') < 0;
-- CVE-2026-21877: n8n after 0.123.0 and before 1.121.3
select * from npm_packages where name='n8n' and vercmp(version, '0.123.0') > 0 and vercmp(version, '1.121.3') < 0;