NewApp Monitoring is liveSign up free
AgentbeamBeta
AI agent vulnerability · n8n

CVE-2026-21893: n8n Vulnerable to Command Injection in Community Package Installation

criticalCVSS 4.0 9.4GHSA-7c4h-vh2m-743m

n8n 0.187.0 up to 1.120.3 has a command injection in community package installation. An administrator can run arbitrary commands on the n8n host through the package version. Upgrade to n8n 1.120.3 or later.

Published Feb 4, 2026 · Analysis Nov 1, 2026

What an attacker can do

The community package installer builds an npm install command from the package name and the version the caller supplies. Before the fix, the controller (community-packages.controller.ts) and parseNpmPackageName in community-packages.service.ts did not check that the version was a real version string. Shell characters in it reached the command line, so the host ran attacker-chosen commands.

The attacker needs an administrative account on the n8n instance. The maintainers stress that admins can already add custom or community code, so this does not widen the threat model much, and they know of no exploitation in the wild. Still, the score is 9.4 critical in CVSS 4.0 because the commands run on the host with the n8n process's rights, which reach stored workflow credentials, environment secrets and anything the host can connect to. The flaw matters most where admin access is shared with less trusted people, or where an admin session could be hijacked.

Who is affected

n8n from 0.187.0 up to, but not including, 1.120.3. Instances with community package installation enabled and more than one administrator deserve the most attention.

n8n --version
npm ls n8n

For Docker, check the image tag.

n8n

Ecosystem
npm
Affected
>= 0.187.0, < 1.120.3
Fixed in
1.120.3
Check
npm ls n8n

How to fix it

Upgrade to n8n 1.120.3 or later:

npm install -g n8n@latest

The fix (PR #21886) validates the version with semver's valid(). The controller rejects bad input with a BadRequestError saying "Invalid version", and parseNpmPackageName throws the same error. The maintainers also advise limiting admin access to trusted users and installing community packages only from trusted sources.

How to tell if you were hit

Look in n8n logs for community package install or update requests whose version field is not a plain version number, for example containing ;, &, |, $( or backticks. On the host, check for child processes of the n8n process that are not npm or node, and for unexpected outbound connections right after a package install. Review the admin audit trail for package installs you did not make.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

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.

Credited to berkdedekarginoglu.

Questions

Can a normal n8n user exploit CVE-2026-21893?

No. The maintainers say it needs administrative access, and no unauthenticated or low-privilege exploitation is possible.

Has it been exploited in the wild?

The maintainers state there is no evidence of exploitation in the wild, and it is not in CISA's KEV data held for this entry.

How was it fixed?

By validating the supplied version with semver valid() in the controller and in parseNpmPackageName, rejecting anything that is not a valid version.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology

More n8n vulnerabilities

All n8n entries