NewApp Monitoring is liveSign up free
AgentbeamBeta
AI agent vulnerability · n8n

CVE-2026-86076: n8n: Expression Sandbox Escape via Class-Field Sanitizer Rebinding Can Lead to Code Execution

highCVSS 4.0 8.7GHSA-hw8v-xxg5-vvvx

An n8n user who can write expressions can escape the expression sandbox through a class field named `__sanitize` and reach the `Function` constructor. On the backend that gives code execution in the n8n process. 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

n8n's expression compiler runs a sanitizer that resolved through a dynamically scoped this. A class field named __sanitize could rebind it, which let the expression reach the Function constructor and build arbitrary code. The fix rejects reserved class-member names.

Two outcomes follow. On the backend, any expression author can run code in the n8n process, which holds the instance's stored credentials and can reach the host and network. In the editor preview, a member's expression can run as JavaScript in the browser session of whoever opens that workflow, so a low-privilege member can target an administrator.

The attacker needs an account that can create or edit workflows (low privileges in the CVSS 4.0 vector, with a present attack requirement). Scope impact is high on a subsequent system. Teams that let many users edit workflows, or that run AI agent nodes whose parameters come from expressions, should treat this as a priority.

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. Check your version:

n8n --version

For Docker, check the image tag. For npm: npm ls n8n. Instances where only fully trusted users can create or edit workflows have lower exposure.

n8n

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, on your release line.

npm install -g [email protected]

Temporary mitigations from n8n: restrict instance access to fully trusted users, avoid granting workflow-create or workflow-edit rights to untrusted users, audit existing workflows for unfamiliar expressions in node parameters, and set N8N_EXPRESSION_ENGINE=vm. These do not fully remove the risk.

How to tell if you were hit

Audit workflows for expressions containing class definitions with a field named __sanitize, or other unusual code inside {{ }} blocks. Review which users created or edited workflows recently. On the host, look for unexpected child processes, outbound connections or file changes from the n8n process. If an admin opened a suspect workflow in the editor, consider rotating the credentials that session could reach.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Impact

The expression compiler's sanitizer resolved through a dynamically-scoped this, so a class field named __sanitize rebound it and reached the Function constructor. On the backend, any expression author could run code in the n8n process; in the editor preview, a member's expression could run as JavaScript in the session of whoever opened the workflow. The patch rejects reserved class-member names.

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:

  • Restrict n8n instance access to fully trusted users only.
  • Avoid granting workflow-create or workflow-edit permissions to untrusted users.
  • Audit existing workflows for unexpected or unfamiliar expressions in node parameters.
  • Set N8N_EXPRESSION_ENGINE=vm.

These workarounds do not fully remediate the risk and should only be used as short-term mitigation measures.

Credited to Masofgon.

Questions

Does CVE-2026-86076 need admin rights?

No. Any user who can author expressions, which means create or edit workflows, can trigger it. That is a low-privilege requirement.

Does setting N8N_EXPRESSION_ENGINE=vm fix it?

n8n lists it as a temporary mitigation, not a full remediation. Upgrade to a fixed version.

Can it hit other users?

Yes. In the editor preview, a member's expression can run as JavaScript in the session of whoever opens the workflow.

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 entries