AgentbeamBeta
AI agent vulnerability · n8n

CVE-2026-27498: n8n has Arbitrary Command Execution via File Write and Git Operations

criticalCVSS 4.0 9.0 · 3.1 8.5GHSA-x2mw-7j39-93xq

A user who can edit n8n workflows can chain the Read/Write Files from Disk node with git operations to run shell commands on the n8n host. They write specific configuration files, then trigger a git operation. Fixed in n8n 1.123.8 and 2.2.0.

Published Feb 25, 2026 · Updated Feb 27, 2026 · Analysis Nov 8, 2026

What an attacker can do

The attack has two steps. First, the Read/Write Files from Disk node writes a file that git reads as configuration. Second, a git operation runs and acts on that file, which makes git launch commands the attacker chose (CWE-94). The advisory does not name the files. Git config files can define programs that git runs, which is the general reason such a chain works.

The attacker needs workflow edit rights and network access. The CVSS 3.1 vector has high attack complexity, 8.5, because the attacker must set up the chain.

Success gives shell command execution as the n8n process. On a shared instance, any workflow author can reach the host, read stored credentials for connected services and move on from there.

Who is affected

npm package n8n, versions before 1.123.8, and 2.0.0 up to but not including 2.2.0. This is an older fix than other recent n8n advisories, so an instance already patched for those is likely clear. Check the version:

npm ls -g n8n

In Docker, check the image tag.

n8n

Ecosystem
npm
Affected
< 1.123.8
Fixed in
1.123.8
Check
npm ls n8n

n8n

Ecosystem
npm
Affected
>= 2.0.0, < 2.2.0
Fixed in
2.2.0
Check
npm ls n8n

How to fix it

Upgrade to n8n 1.123.8 on the 1.x line, or 2.2.0 or later on the 2.x line.

npm install -g [email protected]

Stopgaps from the advisory that do not fully fix it: limit workflow creation and editing to fully trusted users, and add n8n-nodes-base.readWriteFile to the NODES_EXCLUDE environment variable to disable the Read/Write Files from Disk node.

How to tell if you were hit

Look for workflows that use the Read/Write Files from Disk node to write into .git directories or to git config paths, and check for any workflow that also runs git operations. On the host, look for unexpected git config files and for shell processes started by git under the n8n process. Review who edited those workflows.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Impact

An authenticated user with permission to create or modify workflows could chain the Read/Write Files from Disk node with git operations to achieve remote code execution. By writing to specific configuration files and then triggering a git operation, the attacker could execute arbitrary shell commands on the n8n host.

Patches

The issue has been fixed in n8n versions 2.2.0 and 1.123.8. Users should upgrade to one of these versions or later to remediate the vulnerability.

Workarounds

If upgrading is not immediately possible, administrators should consider the following temporary mitigations:

  • Limit workflow creation and editing permissions to fully trusted users only.
  • Disable the Read/Write Files from Disk node by adding n8n-nodes-base.readWriteFile to the NODES_EXCLUDE environment variable.

These workarounds do not fully remediate the risk and should only be used as short-term mitigation measures.

Credited to fatihhcelik.

Questions

Which two features does CVE-2026-27498 chain?

The Read/Write Files from Disk node, to write configuration files, and git operations, to trigger them. The result is shell command execution on the host.

Does CVE-2026-27498 need a login?

Yes, an account with permission to create or modify workflows.

Which versions fix CVE-2026-27498?

n8n 1.123.8 and 2.2.0, or later releases in each line.

How can I limit the risk before upgrading?

Restrict who can edit workflows and exclude n8n-nodes-base.readWriteFile with NODES_EXCLUDE. The advisory says these steps do not fully remove the risk.

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