CVE-2026-86083: n8n: Expression Sandbox Escape via Shared Builtin Tampering and Code-Printer Injection Leads to Code Execution
On n8n instances that use the legacy expression engine, an expression that replaces the global `JSON.stringify` changes the code that n8n generates next, which turns literal data into executable source. It gives code execution to a user who can write expressions. The `vm` engine is not affected. Fixed in n8n 1.123.76, 2.37.7 and 2.38.2.
Published Sep 10, 2026 · Analysis Oct 23, 2026
What an attacker can do
Two stages of expression code generation call the global JSON.stringify at generation time. The compiler uses it when printing synthetic string literals, and the isolate bridge uses it to put a timezone value into its per-evaluation wrapper. Because the call goes through global state, an expression that overwrites JSON.stringify can make later generated code contain attacker text. The patch renders both stages through a reference captured at module load.
The attacker is an authenticated user who can write expressions and has low privileges, with a present attack requirement in the CVSS 4.0 vector. The outcome is command execution in the n8n process, with high confidentiality, integrity and availability impact. That process holds stored credentials for connected services.
Only the legacy expression engine is vulnerable. The vm engine, the default on the patched releases, is not. So the risk is concentrated in older instances and those that set the legacy engine explicitly.
Who is affected
Affected: n8n before 1.123.76; 2.0.0 up to but not including 2.37.7; and 2.38.0 and 2.38.1, only when the legacy expression engine is in use. Check the engine setting N8N_EXPRESSION_ENGINE and the version:
n8n --versionn8n
- Ecosystem
- npm
- Affected
- < 1.123.76
- Fixed in
- 1.123.76
- Check
npm ls n8n
n8n
- Ecosystem
- npm
- Affected
- >= 2.38.0, < 2.38.2
- Fixed in
- 2.38.2
- Check
npm ls n8n
n8n
- Ecosystem
- npm
- Affected
- >= 2.0.0, < 2.37.7
- Fixed in
- 2.37.7
- Check
npm ls n8n
How to fix it
Upgrade to n8n 1.123.76, 2.37.7 or 2.38.2, or later.
npm install -g [email protected]n8n's temporary mitigations: set N8N_EXPRESSION_ENGINE=vm, restrict instance access to fully trusted users, and run the n8n process under a dedicated low-privilege OS account to limit the effect of command execution. These do not fully remediate the risk.
How to tell if you were hit
Search workflow expressions for assignments to JSON.stringify or other overwrites of built-in globals. Check which users edited workflows recently. On the host, look for unexpected child processes, outbound connections, or file writes from the n8n process, which a low-privilege OS account makes easier to spot.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
Impact
Two stages of expression code generation built source text by calling the global JSON.stringify at generation time: the compiler when printing synthetic string literals, and the isolate bridge when interpolating a timezone value into its per-evaluation wrapper. An expression that replaced that global therefore changed the code that was subsequently generated and executed, turning literal data into executable source. The patch renders both code-generation stages through a reference captured at module load, so a later change to global state cannot alter the generated source.
This vulnerability only affects instances running the legacy expression engine. The vm expression engine, which is the default on the patched releases, is not affected.
Patches
The issue has been fixed in n8n versions 1.123.76, 2.37.7, and 2.38.2. 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:
- Set the environment variable
N8N_EXPRESSION_ENGINE=vmto switch to the vm expression engine, which is not affected by this vulnerability. - Restrict n8n instance access to fully trusted users only.
- Ensure the n8n process runs under a dedicated low-privilege OS user account to limit the impact of any command execution.
These workarounds do not fully remediate the risk and should only be used as short-term mitigation measures.
Credited to hiddingtrojans.
Questions
- Is the vm expression engine affected by CVE-2026-86083?
No. The advisory says only the legacy expression engine is affected, and
vmis the default on the patched releases.- What is the quickest mitigation?
Set
N8N_EXPRESSION_ENGINE=vm. n8n lists it as a temporary step; upgrading remains the fix.- Who can exploit it?
An authenticated user able to write expressions, so anyone who can create or edit workflows.
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 entriesCVE-2026-86073
n8n: Per-Resource OAuth Consent Bypass via Unbound Refresh Token Resource Substitution
medium5.9Sep 10, 2026CVE-2026-86074
n8n: Instance AI Credential Setup Accepts Unvalidated Probe URL from Fetched Content
medium5.9Sep 10, 2026CVE-2026-86075
n8n: Unauthenticated Persistent Storage Exhaustion via OAuth Dynamic Client Registration Endpoint
high8.7Sep 10, 2026CVE-2026-86076
n8n: Expression Sandbox Escape via Class-Field Sanitizer Rebinding Can Lead to Code Execution
high8.7Sep 10, 2026CVE-2026-86077
n8n: Anonymous Approval-Gate Bypass via Reused resumeToken over the Chat WebSocket
medium6.3Sep 10, 2026CVE-2026-86078
n8n: Prototype Pollution via Workflow Structure Summary Can Lead to Denial of Service
medium6.0Sep 10, 2026
