/

CVE-2026-126391

Severity:

HIGH RISK

(7.5)

Code Injection (CWE-94) in n8n Workflow Expressions

CVE-2026-126391

Deferred

Vulnerability type

Category:

Code Injection

CWE:

CWE-94

Impact:

Arbitrary Code Execution

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

n8n has an insufficiently isolated workflow expression evaluator that may let authenticated users escape its sandbox and execute code on the host. The risk arises when a user can create or modify workflows and trigger evaluation of a crafted expression.

Affected context

The issue occurs in n8n's workflow expression evaluation, where expressions are intended to run within a restricted sandbox. Deployments may be at risk when authenticated users have permission to create or modify workflows and those workflows are evaluated by the n8n host.

Exploit preconditions

  • Attack surface: Workflow expression evaluation in n8n
  • Required access: Authenticated access with permission to create or modify workflows
  • Trigger point: Evaluation of an expression in a workflow
  • Why exploitation is possible: Unexpected JavaScript property access can bypass the evaluator's isolation boundary and enable code execution

Why this happens

The underlying issue is insufficient isolation between workflow expressions and the host runtime. Expression evaluation exposes or permits access to unexpected JavaScript properties, allowing untrusted workflow logic to cross the sandbox boundary. This maps to CWE-94: Improper Control of Generation of Code, because attacker-influenced input can result in executable code running in the host context.

Potential impact

  • An attacker could execute arbitrary code on the n8n host
  • The host's data and runtime secrets may be exposed or altered
  • The n8n service could be disrupted or used to access other systems, depending on its privileges and network access

General mitigation guidance

Defensive approaches focus on maintaining a robust boundary between user-authored expressions and the host runtime.

  • Use expression evaluation designs that do not expose host objects or unsafe JavaScript properties
  • Treat workflow definitions and expressions as untrusted, including those created by authenticated users
  • Restrict workflow creation and modification to users who need those capabilities
  • Run n8n with least-privilege permissions and limit access to sensitive files, credentials, and network resources
  • Apply secure-by-default policies that constrain expression capabilities and reduce the impact of a sandbox escape

How teams detect issues like this

  • Review expression evaluators for access to host objects, prototypes, constructors, or unexpected JavaScript properties
  • Use static analysis and code review to identify dynamic evaluation and incomplete sandbox boundaries
  • Monitor workflow changes and expression execution, especially for unexpected modifications or unusual host activity
  • Enforce policies that limit who can create or modify workflows and what capabilities their expressions can access
  • Automated code review tools may help flag risky dynamic evaluation patterns

Sources

SourceLink
github.comgithub.com/n8n-io/n8n/security/advisories/GHSA-gx3v-3x3v-f8r5
vulncheck.comvulncheck.com/advisories/n8n-before-1.123.89-rce-via-workflow-expression-evaluation-sandbox-escape

Frequently asked

questions

Exploitation may be possible through the n8n application by an authenticated user who can create or modify workflows; it does not necessarily require direct host access.

The attacker needs authenticated access with permission to create or modify a workflow whose expressions are evaluated.

Ensure expression evaluation cannot access host capabilities or escape its isolation boundary, and limit workflow editing privileges.

Treat user-authored workflows as untrusted, use restrictive evaluation designs, review sandbox boundaries, and run the service with least privilege.

Find out what's already
exploitable in your codebase.