CVE-2026-21877: N8n Remote Code Execution Vulnerability
CRITICALCVE-2026-21877 is a CRITICAL (CVSS 9.9) remote code execution vulnerability (CWE-434: Unrestricted Upload of File with Dangerous Type) affecting N8n libraries in the npm ecosystem. The issue involves n8n vulnerable to rce via arbitrary file write. Remediation is available by upgrading affected packages to version 1.121.3.
CVE-2026-21877 at a Glance
Security Impact
CVSS: 9.9
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H).
How to Fix CVE-2026-21877
To remediate this vulnerability, upgrade all affected N8n dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install n8n@1.121.3
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls n8n
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2026-21877, inspect your project dependencies using npm:
npm ls n8n
Analyze the terminal output to locate any version of N8n in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.121.3), your application is affected.
Note: The npm ls n8n command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-434: Unrestricted Upload of File with Dangerous Type, where the product allows the upload or transfer of dangerous file types that are automatically processed within its environment. In N8n, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-21877 Affected N8n Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
n8n
|
npm |
≥ 0.123.0
< 1.121.3
|
1.121.3
|
References
Frequently Asked Questions
What is CVE-2026-21877?
Which N8n versions are affected?
What version fixes CVE-2026-21877?
Is n8n affected?
What is the CVSS score of CVE-2026-21877?
What CWE is associated with CVE-2026-21877?
How can I check npm dependencies for CVE-2026-21877?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-v364-rw7m-3263",
"modified" : "2026-01-06T17:48:24Z",
"published" : "2026-01-06T17:48:24Z",
"aliases" : [ "CVE-2026-21877" ],
"summary" : "n8n Vulnerable to RCE via Arbitrary File Write",
"details" : "### Impact\nn8n is affected by an authenticated Remote Code Execution (RCE) vulnerability.\n\nUnder certain conditions, an authenticated user may be able to cause untrusted code to be executed by the n8n service. This could result in full compromise of the affected instance.\n\nBoth self-hosted and n8n Cloud instances are impacted.\n\n### Patches\nThe issue has been resolved in n8n version 1.121.3.\n\nUsers are advised to upgrade to this version or later to fully address the vulnerability.\n\n### Workarounds\nIf upgrading is not immediately possible, administrators can reduce exposure by disabling the Git node and limiting access for untrusted users.\n\n### References\n- n8n documentation: [Blocking access to nodes](https://docs.n8n.io/hosting/securing/blocking-nodes/)",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "n8n"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0.123.0"
}, {
"fixed" : "1.121.3"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/n8n-io/n8n/security/advisories/GHSA-v364-rw7m-3263"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/n8n-io/n8n"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-434" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2026-01-06T17:48:24Z",
"nvd_published_at" : null
}
}