CVE-2026-21893: N8n N8n Vulnerable To Command Injection Vulnerability

CRITICAL
Advisory Identifier: GHSA-7c4h-vh2m-743m
CWE-78 CWE-20
Published
Advisory Summary

CVE-2026-21893 is a CRITICAL n8n vulnerable to command injection vulnerability (CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')) affecting N8n libraries in the npm ecosystem. The issue involves n8n vulnerable to command injection in community package installation. Remediation is available by upgrading affected packages to version 1.120.3.

CVE-2026-21893 at a Glance

CVE Identifier CVE-2026-21893
GHSA Identifier GHSA-7c4h-vh2m-743m
Severity CRITICAL
CVSS v3.1 Base Score N/A
CWE Classification CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
Affected Product N8n
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2026-21893

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.

n8n fixed: 1.120.3
npm install n8n@1.120.3
Verify Direct and Transitive Dependencies

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-21893, 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.120.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-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'), where the product constructs all or part of an os command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended os command when it is sent to a downstream component. 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

### Impact A Command Injection vulnerability was identified in n8n’s community package installation functionality. The issue allowed authenticated users with administrative permissions to execute arbitrary system commands on the n8n host under specific conditions. **Important context** - Exploitation requires _administrative_ access to the n8n instance. - The affected functionality is restricted to trusted users who are already permitted to install third-party community packages. - No unauthenticated or low-privilege exploitation is possible. - There is no evidence of exploitation in the wild. Because administrative users can already extend n8n with custom or community code, the vulnerability does not meaningfully expand the threat model beyond existing administrator capabilities. However, it represents a violation of secure coding practices and has therefore been addressed. ### Patches Users are advised to upgrade to n8n version 1.120.3 or later, which fully resolves the issue. As a general security best practice, n8n instance owners should ensure that: - Administrative access is limited to trusted users only. - Community packages are installed only from trusted sources. - Instances are kept up to date with the latest security releases.

CVE-2026-21893 Affected N8n Versions

1 component(s)
Fixed Versions:
1.120.3
Product / Package Ecosystem Affected Versions Fixed Version
n8n
npm
≥ 0.187.0
< 1.120.3
1.120.3

References

Frequently Asked Questions

What is CVE-2026-21893?
CVE-2026-21893 is a security vulnerability in N8n involving n8n Vulnerable to Command Injection in Community Package Installation under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
Which N8n versions are affected?
Affected versions include releases prior to 1.120.3 across affected packages: n8n.
What version fixes CVE-2026-21893?
Upgrading to 1.120.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is n8n affected?
Yes, n8n is affected in releases prior to 1.120.3. Upgrade your dependency to 1.120.3 or later.
What CWE is associated with CVE-2026-21893?
CVE-2026-21893 is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') (The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.).
How can I check npm dependencies for CVE-2026-21893?
Run the dependency tree command: 'npm ls n8n'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-7c4h-vh2m-743m",
  "modified" : "2026-02-04T19:53:12Z",
  "published" : "2026-02-04T17:49:38Z",
  "aliases" : [ "CVE-2026-21893" ],
  "summary" : "n8n Vulnerable to Command Injection in Community Package Installation",
  "details" : "### Impact\nA Command Injection vulnerability was identified in n8n’s community package installation functionality. The issue allowed authenticated users with administrative permissions to execute arbitrary system commands on the n8n host under specific conditions.\n\n**Important context**\n\n- Exploitation requires _administrative_ access to the n8n instance.\n- The affected functionality is restricted to trusted users who are already permitted to install third-party community packages.\n- No unauthenticated or low-privilege exploitation is possible.\n- There is no evidence of exploitation in the wild.\n\nBecause administrative users can already extend n8n with custom or community code, the vulnerability does not meaningfully expand the threat model beyond existing administrator capabilities. However, it represents a violation of secure coding practices and has therefore been addressed.\n\n### Patches\nUsers are advised to upgrade to n8n version 1.120.3 or later, which fully resolves the issue.\n\nAs a general security best practice, n8n instance owners should ensure that:\n- Administrative access is limited to trusted users only.\n- Community packages are installed only from trusted sources.\n- Instances are kept up to date with the latest security releases.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "n8n"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.187.0"
      }, {
        "fixed" : "1.120.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/n8n-io/n8n/security/advisories/GHSA-7c4h-vh2m-743m"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-21893"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/n8n-io/n8n/commit/ae0669a736cc496beeb296e115267862727ae838"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/n8n-io/n8n"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-20", "CWE-78" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-02-04T17:49:38Z",
    "nvd_published_at" : "2026-02-04T18:16:08Z"
  }
}