n8n Sandbox Escape Vulnerability Allows Workflow Editors to Execute OS Commands

n8n, the open-source workflow automation platform, has addressed a high-severity vulnerability that permitted authenticated workflow editors to execute operating system commands on the server hosting the application. This flaw, identified by Security Joes, emerged during an analysis of a previous fix for CVE-2026-27577, revealing another potential bypass.

The vulnerability affected n8n versions prior to 2.31.5 and between 2.32.0 and 2.32.1. The issue has been resolved in versions 2.31.5 and 2.32.1. n8n has cataloged this flaw as GHSA-gv7g-jm28-cr3m, assigning it a CVSS 4.0 score of 8.7. As of July 27, 2026, no CVE identifier had been assigned.

Administrators are strongly advised to update their n8n instances promptly. While interim measures such as restricting access to trusted users were suggested, these are considered incomplete and should not replace the application of the official patches. Notably, the advisory does not mention any patched releases for the 1.x series or specify whether n8n Cloud services were impacted.

Exploitation of this vulnerability requires an authenticated account with permissions to create or modify workflows, without necessitating any action from other users. Successful exploitation allows the execution of commands with the same privileges as the n8n process.

Security Joes highlighted that exploiting this flaw could expose sensitive information, including the N8N_ENCRYPTION_KEY, potentially leading to the decryption of credentials stored within n8n. This access could further extend to connected databases, internal services, and cloud endpoints. At the time of their report, there was no evidence of this vulnerability being exploited in the wild.

The root cause of the vulnerability lies in how n8n processes expressions within workflows. Users often employ expressions like ={{ $json.email }}. An abstract syntax tree (AST) rewriter is intended to redirect free JavaScript identifiers in these expressions to n8n’s controlled data context, rather than the Node.js runtime. However, in version 2.31.4, the VariablePolyfill.ts file placed ArrowFunctionExpression in a no-operation branch. Consequently, concise arrow functions, such as () => process, could resolve process to the actual Node.js global object instead of the sandboxed version.

Additionally, n8n’s property checks, which inspect static property names in member expressions, were found to be insufficient. By leveraging Reflect.get(), which receives the requested property as a function argument, attackers could access process.getBuiltinModule, load child_process, and execute commands on the host system.

Security Joes tested their proof-of-concept against n8n version 2.30.4, both using the released workflow package and a local instance. A comparison between the public 2.31.4 and 2.31.5 source files confirmed the arrow-function issue. The fixed rewriter in version 2.31.5 introduces a dedicated ArrowFunctionExpression handler that routes bare identifiers in concise arrow bodies through the data context.

Security Joes emphasized that neither of the identified conditions alone was sufficient for exploitation, and both were not covered by existing tests. They initially estimated the flaw’s severity to be comparable to the 9.4 Critical rating of CVE-2026-27577; however, n8n’s published score is 8.7.

The vulnerability was identified on July 14 and reported to n8n’s vulnerability disclosure program on July 15. The patched releases were made available on July 22. Administrators are encouraged to review recent workflows for unexpected arrow functions or obfuscated JavaScript and to monitor for suspicious child processes spawned by n8n or Node.js, such as shells, PowerShell, curl, or wget. If any suspicious activity is detected, it is advisable to rotate credentials promptly.

This discovery adds to a series of expression-sandbox escapes that n8n has addressed since 2025, underscoring the importance of continuous vigilance and prompt patching in maintaining the security of automation platforms.