/

CVE-2026-27493

Severity:

CRITICAL RISK

(9.0)

Expression Injection / Code Injection in n8n Form Nodes

CVE-2026-27493

Analyzed

Vulnerability type

Category:

Expression Injection / Code Injection

CWE:

CWE-94, CWE-95

Impact:

Arbitrary Expression Evaluation with Potential Remote Code Execution

Severity:

CRITICAL RISK

(9.0)

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

A second-order expression injection issue in n8n's Form nodes allowed crafted form submissions to be reinterpreted as n8n expressions whenever user-controlled values were interpolated into expression-enabled fields.

In specific workflow configurations, an unauthenticated attacker could cause arbitrary expression evaluation, which, when combined with a separate sandbox escape, could escalate to remote code execution on the n8n host.

Affected context

The vulnerability occurs within n8n workflows that use Form or Form Trigger nodes and interpolate user-provided form values into expression-aware fields.

It is only reachable when:

  • A Form node accepts input from unauthenticated users (e.g., public forms), and
  • At least one field in the workflow uses interpolation of that user input, and
  • The stored value is later re-evaluated by n8n's expression engine.

Under these conditions, a value starting with = was treated as an expression and evaluated twice, enabling second-order expression injection.

Exploit preconditions

  • Attack surface: Publicly or semi-publicly exposed n8n Form/Form Trigger endpoints that process user-submitted data.
  • Required access: Ability to submit crafted form data; no prior authentication is required if the form is public.
  • Workflow configuration:
  • A Form node field must interpolate a value derived from unauthenticated user input.
  • That value must later be interpreted again by the expression engine (double-evaluation scenario).
  • The attacker-controlled field content must begin with = so n8n treats it as an expression.
  • Why exploitation is possible: n8n's expression handling logic treated leading = values as expressions and performed a second evaluation on interpolated content, allowing attacker-supplied data to be interpreted as code-like expressions instead of inert data.

Why this happens

The core issue is a mismatch between data and code boundaries inside the expression engine, aligning with CWE-95: Improper Neutralization of Directives in Dynamically Evaluated Code ('Eval Injection').

n8n Form nodes allowed user-controlled values to flow into expression-enabled fields where a leading = implicitly upgraded that data into executable expression syntax.

Because the system later reprocessed that same content, a second evaluation phase occurred, turning previously stored user input into active expressions.

This double-evaluation pattern—data ingestion followed by later reinterpretation as code—creates a second-order injection condition, where the dangerous effect manifests not at initial input but at a later use site.

While the expression environment is sandboxed, any flaw or bypass inside that sandbox (a separate bug class) can turn this expression injection into full CWE-94: Code Injection against the underlying host.

Potential impact

  • Evaluation of arbitrary n8n expressions within the workflow's expression context.
  • Unauthorized access to workflow data, variables, and internal metadata exposed to the expression engine.
  • Manipulation of workflow logic, routing, or data transformation steps.
  • When chained with an expression sandbox escape, potential remote code execution on the n8n host.
  • Lateral movement within the automation environment, including access to connected services and secrets exposed via expressions.

General mitigation guidance

Long-term mitigation focuses on maintaining a strict separation between user data and expression syntax, and on avoiding double-evaluation patterns:

  • Harden expression handling:
  • Treat user input as data only and avoid any automatic upgrade of user-controlled values into expressions based on prefix characters such as =.
  • Ensure expressions are evaluated at most once and that stored values are never implicitly reinterpreted as code.
  • Constrain where expressions can appear:
  • Limit expression-enabled fields to contexts that do not directly interpolate untrusted user input.
  • Use explicit, strongly-typed parameters and schema validation for form fields to prevent injection of directive-like prefixes.
  • Reduce trust in workflow inputs:
  • Treat all form-submitted values as untrusted and sanitize or encode them before using them in any dynamic computations.
  • Avoid designs where public forms drive high-privilege workflow steps without intermediate validation or moderation.
  • Limit blast radius:
  • Run the expression engine with least privilege and a minimal, well-audited sandbox surface.
  • Isolate automation hosts and restrict access to secrets, system commands, and infrastructure control planes.

These design patterns help reduce the risk of both first-order and second-order injection vulnerabilities across automation workflows.

How teams detect issues like this

Detection should focus on identifying double-evaluation patterns and user-input flows into expression-enabled fields:

  • Static analysis and configuration review:
  • Search workflow definitions for Form/Form Trigger nodes that interpolate request or form fields into other expression-enabled fields.
  • Flag any logic that conditionally or repeatedly evaluates dynamically constructed expressions.
  • Detect patterns where data containing expression delimiters (e.g., = at the beginning) is later passed into expression evaluation APIs.
  • Code review signals:
  • Pay attention to areas where user input is stored, transformed, and then later reinterpreted as part of expressions.
  • Review expression-related utility functions for implicit behaviors (e.g., "if startsWith('=') then treat as expression").
  • Runtime monitoring:
  • Log and monitor expression evaluation events, including the raw expressions being executed, and alert on anomalous patterns (e.g., frequent expressions starting with user-supplied text).
  • Instrument form endpoints to capture suspicious payloads where fields are prefixed with = unexpectedly.
  • Automated tooling:
  • Use security scanners or custom linters that understand n8n workflow formats to detect flows from untrusted form fields to expression contexts.
  • Integrate these checks into CI/CD so dangerous workflow patterns are identified before deployment.

Sources

SourceLink
github.comgithub.com/n8n-io/n8n/commit/562d867483e871b0f1e31776252e23bd721df75b
github.comgithub.com/n8n-io/n8n/issues/19
github.comgithub.com/n8n-io/n8n/releases/tag/n8n@1.123.22
github.comgithub.com/n8n-io/n8n/releases/tag/n8n@2.10.1
github.comgithub.com/n8n-io/n8n/releases/tag/n8n@2.9.3
github.comgithub.com/n8n-io/n8n/security/advisories/GHSA-75g8-rv7v-32f7

Frequently asked

questions

Exploitability is constrained by workflow design: only instances using Form/Form Trigger nodes that interpolate unauthenticated user input into expression-enabled fields and later re-evaluate that data are affected.

Many workflows will not meet these conditions, and an attacker must either know or discover a susceptible form.

Not necessarily.

If a workflow exposes a public form, an unauthenticated attacker can submit crafted payloads to that endpoint and potentially trigger expression injection under the specific configuration conditions.

The safest pattern is to ensure user-controlled values are never automatically treated as expressions.

Expressions should only come from trusted, designer-controlled sources, and any value originating from end users must remain inert data even if it resembles expression syntax (such as starting with =).

Adopt a strict "data versus code" separation policy in automation and workflow engines, avoid double evaluation of content, enforce schemas for all user inputs, and minimize the power and surface area of the expression engine.

Augment this with regular security reviews of workflow templates and automated checks that flag flows from untrusted input into any dynamic evaluation mechanism.

Find out what's already
exploitable in your codebase.