A critical unauthenticated remote code execution (RCE) vulnerability, assigned CVE-2026-21858 and codenamed "Ni8mare," affects self-hosted instances of the n8n workflow automation platform. The vulnerability has been rated with a CVSS score of 10.0, signifying maximum severity. It allows an attacker to execute arbitrary code on the server without any authentication, leading to a complete system compromise. The flaw, discovered by Cyera Research Labs, is a Content-Type confusion bug that enables an attacker to manipulate file access on the underlying server. Given that many n8n instances are internet-facing and used to orchestrate sensitive business processes and handle credentials, this vulnerability poses an extreme risk. The issue was patched in version 1.121.0, and administrators of all prior versions must upgrade immediately to prevent exploitation.
The vulnerability exists in the way n8n processes certain incoming web requests, specifically those related to form submissions. According to the researchers at Cyera, a function responsible for handling form data incorrectly invokes a file-handling function without first verifying that the request's Content-Type header is multipart/form-data. This oversight creates a logical flaw where an attacker can send a specially crafted request with a different content type (e.g., application/json) to manipulate an object that is subsequently used in file path operations. By controlling this object, the attacker can traverse the filesystem and execute code on the server hosting the n8n instance. The attack vector is via the network, requires no user interaction, and has low complexity, justifying the 10.0 CVSS score.
1.121.01.121.0 and laterThe vulnerability was responsibly disclosed to the n8n team on November 9, 2025, and a patch was released on November 18, 2025. However, the public disclosure, including technical details and proof-of-concept (PoC) information, occurred on January 7, 2026. The availability of a PoC significantly increases the likelihood of widespread exploitation attempts against unpatched, internet-facing n8n instances.
A successful exploit of CVE-2026-21858 would be catastrophic for an affected organization. The attacker would gain full control of the n8n server, equivalent to root or administrator privileges for the service. This access allows them to:
Content-Type (e.g., application/json instead of multipart/form-data) but are processed by form-handling logic.sh, bash, powershell.exe, curl, wget).Content-Type does not match the expected type for that endpoint's function.D3-NTA: Network Traffic Analysis to look for anomalous outbound connections from the n8n server, which could indicate a post-exploit C2 channel or data exfiltration.1.121.0 or newer. This is a direct application of M1051 - Update Software.M1037 - Filter Network Traffic.The primary mitigation is to apply the security patch provided by the vendor by upgrading to a non-vulnerable version.
Mapped D3FEND Techniques:
As a compensating control, restrict network access to the vulnerable application to only trusted sources, reducing the attack surface.
Mapped D3FEND Techniques:
Running the n8n application in a container or a sandboxed environment can limit the impact of a successful RCE, preventing the attacker from easily accessing the underlying host system.
Mapped D3FEND Techniques:
Given the critical CVSS 10.0 score and the unauthenticated nature of CVE-2026-21858, immediate patching is the only acceptable remediation. All administrators of self-hosted n8n instances must prioritize upgrading to version 1.121.0 or newer. This action directly removes the vulnerability from the environment. A robust patch management program should be in place to identify all n8n instances, confirm their versions, and deploy the update. Verification should be performed post-patch to ensure the upgrade was successful and the service is running a non-vulnerable version. Due to the public availability of PoC code, any delay in patching exposes the organization to a high probability of compromise.
For defense-in-depth and as a temporary measure if patching is delayed, deploy a Web Application Firewall (WAF) in front of all n8n instances. Configure the WAF with a specific rule to inspect inbound traffic to n8n webhook endpoints. The rule should block any request to a form-handling endpoint that does not have the expected Content-Type of multipart/form-data. This virtual patch would disrupt the specific exploit mechanism described by researchers. Additionally, restrict all access to the n8n management interface and API to a small set of trusted internal IP addresses at the network firewall level. This drastically reduces the attack surface available to external, unauthenticated attackers.
To detect potential exploitation of CVE-2026-21858, security teams should configure their EDR or host-based monitoring tools to scrutinize processes spawned by the n8n service (typically a node process). A baseline of normal child process activity should be established. Create high-severity alerts for any instance where the n8n process spawns a shell (/bin/sh, bash, cmd.exe, powershell.exe) or network utilities like curl or wget. In a normal operating state, the application should not be executing these commands. Such an event is a very strong indicator of a successful RCE exploit. The alert should trigger an automated response to isolate the host and initiate an incident response investigation.

Cybersecurity professional with over 10 years of specialized experience in security operations, threat intelligence, incident response, and security automation. Expertise spans SOAR/XSOAR orchestration, threat intelligence platforms, SIEM/UEBA analytics, and building cyber fusion centers. Background includes technical enablement, solution architecture for enterprise and government clients, and implementing security automation workflows across IR, TIP, and SOC use cases.
Help others stay informed about cybersecurity threats