CVE-2026-21877: n8n: Code Injection enables RCE

CRITICAL NUCLEI TEMPLATE
Published January 8, 2026
CISO Take

CVE-2026-21877 is a critical (9.9) authenticated RCE in n8n, the workflow automation platform widely deployed as an AI agent orchestration layer. Any n8n instance with untrusted users—including n8n Cloud—is at risk: patch immediately to 1.121.3. If patching is delayed, disable the Git node and audit authenticated access now, as low-privilege accounts are sufficient to achieve full system compromise and pivot to every connected AI service.

What is the risk?

Risk is CRITICAL. CVSS 9.9 with Changed scope means compromise extends beyond n8n itself to all connected services—LLM APIs, databases, internal systems. Attack complexity is Low and only low-privilege authentication is required with no user interaction. n8n is pervasive in AI agent pipelines, acting as the orchestration layer between LLMs, APIs, and data sources. A compromised instance typically holds API keys for OpenAI, Anthropic, and Azure OpenAI, database credentials, webhook secrets, and access to internal infrastructure, making the blast radius extremely wide. Cloud instances are explicitly confirmed affected, meaning SaaS customers are not protected by network-level mitigations alone.

What systems are affected?

Package Ecosystem Vulnerable Range Patched
n8n npm No patch
193.4K OpenSSF 6.6 Pushed 2d ago 55% patched ~7d to patch Full package profile →

Do you use n8n? You're affected.

How severe is it?

CVSS 3.1
9.9 / 10
EPSS
5.3%
chance of exploitation in 30 days
Higher than 91% of all CVEs
Exploitation Status
Exploit Possible
Exploitation: LOW
Sophistication
Trivial
Exploitation Confidence
low
Nuclei detection template available
Composite signal derived from CISA KEV, VulnCheck KEV, CISA SSVC, EPSS, Metasploit, Exploit-DB, trickest/cve, Nuclei templates, and inthewild.io exploitation reports.

What is the attack surface?

AV AC PR UI S C I A
AV Network
AC Low
PR Low
UI None
S Changed
C High
I High
A High

What should I do?

6 steps
  1. PATCH IMMEDIATELY

    Upgrade n8n to version 1.121.3 or later—this is the only complete remediation.

  2. INTERIM WORKAROUND

    Disable the Git node in n8n node settings if immediate patching is not possible.

  3. ACCESS CONTROL

    Audit all n8n user accounts; remove or demote untrusted or unnecessary accounts. Enforce least-privilege—restrict who can create or modify workflows.

  4. ROTATE CREDENTIALS

    After patching, rotate all API keys, database passwords, and secrets stored in n8n credentials; assume compromise if any untrusted users had authenticated access.

  5. DETECTION

    Review n8n execution logs for unexpected workflow runs, anomalous Git node activity, or outbound connections to unknown hosts. Audit workflow change history for modifications by non-admin accounts.

  6. NETWORK HARDENING

    Place internet-facing n8n instances behind VPN or IP allowlist until patching is complete. Monitor for reverse shell indicators (unexpected outbound TCP on non-standard ports from the n8n process).

What does CISA's SSVC say?

Decision Track
Exploitation none
Automatable No
Technical Impact total

Source: CISA Vulnrichment (SSVC v2.0). Decision based on the CISA Coordinator decision tree.

How is it classified?

Which compliance frameworks are affected?

This CVE is relevant to:

EU AI Act
Art. 15 - Accuracy, Robustness and Cybersecurity Art. 9 - Risk Management System Article 15 - Accuracy, robustness and cybersecurity Article 9 - Risk management system
ISO 42001
A.6.2 - AI system lifecycle management A.9.3 - AI system security A.9.4 - Information Security
NIST AI RMF
GOVERN-1.2 - Policies and procedures for AI risk management MANAGE 2.4 - Mechanisms for Incident Response MANAGE-2.4 - Incident response and recovery for AI systems MEASURE 2.5 - AI System Security Evaluation
OWASP LLM Top 10
LLM07 - Insecure Plugin Design LLM08 - Excessive Agency

Frequently Asked Questions

What is CVE-2026-21877?

CVE-2026-21877 is a critical (9.9) authenticated RCE in n8n, the workflow automation platform widely deployed as an AI agent orchestration layer. Any n8n instance with untrusted users—including n8n Cloud—is at risk: patch immediately to 1.121.3. If patching is delayed, disable the Git node and audit authenticated access now, as low-privilege accounts are sufficient to achieve full system compromise and pivot to every connected AI service.

Is CVE-2026-21877 actively exploited?

No confirmed active exploitation of CVE-2026-21877 has been reported, but organizations should still patch proactively.

How to fix CVE-2026-21877?

1. PATCH IMMEDIATELY: Upgrade n8n to version 1.121.3 or later—this is the only complete remediation. 2. INTERIM WORKAROUND: Disable the Git node in n8n node settings if immediate patching is not possible. 3. ACCESS CONTROL: Audit all n8n user accounts; remove or demote untrusted or unnecessary accounts. Enforce least-privilege—restrict who can create or modify workflows. 4. ROTATE CREDENTIALS: After patching, rotate all API keys, database passwords, and secrets stored in n8n credentials; assume compromise if any untrusted users had authenticated access. 5. DETECTION: Review n8n execution logs for unexpected workflow runs, anomalous Git node activity, or outbound connections to unknown hosts. Audit workflow change history for modifications by non-admin accounts. 6. NETWORK HARDENING: Place internet-facing n8n instances behind VPN or IP allowlist until patching is complete. Monitor for reverse shell indicators (unexpected outbound TCP on non-standard ports from the n8n process).

What systems are affected by CVE-2026-21877?

This vulnerability affects the following AI/ML architecture patterns: agent frameworks, workflow automation pipelines, RAG pipelines, LLM integration layers, CI/CD pipelines with AI components.

What is the CVSS score for CVE-2026-21877?

CVE-2026-21877 has a CVSS v3.1 base score of 9.9 (CRITICAL). The EPSS exploitation probability is 5.26%.

What is the AI security impact?

Affected AI Architectures

agent frameworksworkflow automation pipelinesRAG pipelinesLLM integration layersCI/CD pipelines with AI components

MITRE ATLAS Techniques

AML.T0012 Valid Accounts
AML.T0049 Exploit Public-Facing Application
AML.T0050 Command and Scripting Interpreter
AML.T0053 AI Agent Tool Invocation
AML.T0072 Reverse Shell
AML.T0081 Modify AI Agent Configuration
AML.T0083 Credentials from AI Agent Configuration
AML.T0105 Escape to Host
AML.T0108 AI Agent

Compliance Controls Affected

EU AI Act: Art. 15, Art. 9, Article 15, Article 9
ISO 42001: A.6.2, A.9.3, A.9.4
NIST AI RMF: GOVERN-1.2, MANAGE 2.4, MANAGE-2.4, MEASURE 2.5
OWASP LLM Top 10: LLM07, LLM08

What are the technical details?

Original Advisory

n8n is an open source workflow automation platform. In versions 0.121.2 and below, an authenticated attacker may be able to execute malicious code using the n8n service. This could result in full compromise and can impact both self-hosted and n8n Cloud instances. This issue is fixed in version 1.121.3. Administrators can reduce exposure by disabling the Git node and limiting access for untrusted users, but upgrading to the latest version is recommended.

Exploitation Scenario

An adversary targeting an organization's AI infrastructure obtains low-privilege access to n8n—via credential stuffing against the login page, a compromised employee account, or a trial account on n8n Cloud. The attacker creates a new workflow containing a Git node configured to clone a malicious repository. The repository contains a crafted payload exploiting CWE-434 (unrestricted file upload) that triggers CWE-94 (code injection) when the Git node processes the repository contents, executing arbitrary code in the n8n service process. The attacker then dumps all n8n stored credentials (OpenAI/Anthropic API keys, database passwords, webhook secrets), establishes persistence via a reverse shell, pivots to connected AI services and internal databases, and modifies existing agent workflows to introduce data exfiltration backdoors affecting every document processed by those pipelines going forward.

Weaknesses (CWE)

CWE-434 — Unrestricted Upload of File with Dangerous Type: The product allows the upload or transfer of dangerous file types that are automatically processed within its environment.

  • [Architecture and Design] Generate a new, unique filename for an uploaded file instead of using the user-supplied filename, so that no external input is used at all.[REF-422] [REF-423]
  • [Architecture and Design] When the set of acceptable objects, such as filenames or URLs, is limited or known, create a mapping from a set of fixed input values (such as numeric IDs) to the actual filenames or URLs, and reject all other inputs.

Source: MITRE CWE corpus.

CVSS Vector

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H

Timeline

Published
January 8, 2026
Last Modified
January 20, 2026
First Seen
January 8, 2026

Scanner Template Available

A Nuclei vulnerability scanner template exists for this CVE. You can scan your infrastructure for this vulnerability immediately.

View template on GitHub
nuclei -t http/cves/2026/CVE-2026-21877.yaml -u https://target.example.com

Related Vulnerabilities