n8n expression compiler can run arbitrary code through class field names

HighSE Fix-First Score 43/100CVE-2026-86076SE-AIV-01786Remote code executionAI softwareMade public 10 Sep 2026

Download as PDF

What this means

An attacker with workflow create or edit access can run code as the n8n process on the backend, or in the browser of anyone who opens a workflow. This can steal credentials, modify workflows, access data processed by n8n, or take over the account.

SecurityElites Manager Brief: the decision in one minute

n8n can run arbitrary code through workflow expressions. Anyone who can edit workflows can take over the n8n backend or the browser sessions of colleagues. Upgrade all n8n instances now.

SecurityElites Fix-First Score43 of 100
Our own ranking of what to fix first. Real attacks count most, then the chance of attack, then severity.
SecurityElites fix windowWithin 30 days
High severity. This is our suggestion from common practice; your own policy comes first.
Who should own the fixPlatform or infrastructure team responsible for n8n deployment and updates.
Likely effortAbout 30 minutes per n8n instance: download the patched version, back up your database, upgrade, and restart. Longer if you run multiple instances or have custom deployments.

Questions to ask your team or supplier

  • Do we allow untrusted users (contractors, customers, external teams) to create or edit workflows? If yes, this is critical.
  • What sensitive data or external systems does n8n have access to, and what would happen if an attacker gained code execution in the n8n process?
  • Do we have an audit trail of who edited workflows and when? Can we review workflow changes from the period before we apply this patch?

Message you can forward to the owning team

Security notice: n8n expression compiler can run arbitrary code through class field names (CVE-2026-86076)

Severity: High
SecurityElites Fix-First Score: 43 of 100
SecurityElites fix window: Within 30 days
Action: upgrade to n8n 2.38.2 or later.
What we need from you: confirm whether we run this software, who owns it, and the date it will be fixed.
Full guide: https://securityelites.com/ai-vulnerabilities/cve-2026-86076-n8n-expression-compiler-can-run-arbitrary-code-through-class/
Source: SecurityElites AI Vulnerabilities Database, record SE-AIV-01786

What is at stake in your AI setup

  • Credentials stored in n8n for external AI providers (API keys, authentication tokens) could be stolen or used by an attacker.
  • Prompts, chat history, and input data processed by AI agents connected to n8n could be exfiltrated or modified.
  • Workflows that call AI models or APIs could be redirected to send data to attacker-controlled endpoints.
  • The compute bill for AI services could spike if an attacker uses compromised credentials to run expensive models.

Map where your company uses AI

Who is exposed

  • n8n instances where untrusted users can create or edit workflows
  • Shared n8n instances used by multiple teams or customers
  • n8n instances exposed to the internet without additional access controls
  • Instances running versions before 1.123.76, 2.37.7, or 2.38.2

Upgrades you need

SoftwareAffected versionsMove to
n8n
npm
Every version before 1.123.76; 2.38.0 up to, but not including, 2.38.2; 2.0.0 up to, but not including, 2.37.72.38.2 or later

Each maintained branch has its own fixed version. Stay on your branch if you cannot jump to the newest: n8n 1.123.76, 2.37.7, 2.38.2.

Am I affected?

Enter the version you run. Nothing you type is stored.

SecurityElites Developer Brief: the technical picture

Is it being attackedNo known attacks and no public attack code when CISA last reviewed it
Where the attacker must beAnywhere that can reach it over a network, including the internet if it is exposed
Account neededAn ordinary user account
Does a person have to do somethingNo. It works without anyone clicking or opening anything
How hard it is to doEasy. It works reliably once the attacker can reach it
Risk of: data being readHigh
Risk of: data or settings being changedHigh
Risk of: the service being taken downHigh
Can attackers automate it at scaleNo, according to CISA. Each target needs manual work
How much control an attacker gainsTotal control of the affected software, according to CISA

Read from the official severity rating: CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:H/VI:H/VA:H/SC:H/SI:N/SA:N

Kind of coding mistake

  • CWE-94: code can be injected

If you cannot upgrade today

  • Until you can upgrade: restrict n8n access to only fully trusted users. Remove workflow create and edit permissions from untrusted users.
  • Set the environment variable `N8N_EXPRESSION_ENGINE=vm` to use a safer expression evaluation mode (this is a partial mitigation and does not fully fix the issue).
  • Audit all existing workflows for unexpected or unfamiliar expressions before granting edit access to new users.

Signs it may already have been used against you

  • Review n8n logs for unexpected code execution or errors during expression evaluation, especially before the upgrade date.
  • Check system process logs for unexpected child processes spawned by the n8n process (node or n8n binary).
  • Search workflow audit logs for edits by users with low trust levels or during unusual times.
  • Look for workflows with expressions containing double-underscore (`__`) names, reserved keywords, or unusual class syntax in node parameters.

Log searches to start from

Unusual child process spawned by n8n (adapt process_name and parent_process fields to your logs)Splunk

process_name=node parent_process=n8n | stats count by process_name, command_line | where count > baseline

Expressions with double-underscore in workflow edits (adapt field names to your audit log structure)Elastic

process.name:n8n AND action:workflow_edit AND expression:__*

Written with AI as a starting point. Review them and change the index and field names to match your own logs before you rely on the result.

SecurityElites Fix Guide: step by step

  1. Find all n8n instances in your environmentList every server, container, or cloud deployment running n8n. Record the hostname, deployment method (Docker, npm, cloud-hosted), and current version of each.
  2. Check the version of each n8n instanceLog in to each n8n instance or check the deployment logs. The version is shown in the UI footer or in package.json. Record whether each instance is at 1.123.76 or later, 2.37.7 or later, or 2.38.2 or later.
  3. Back up the n8n databaseIf n8n uses a database (SQLite, PostgreSQL, MySQL), create a full backup before upgrading. The database location depends on your deployment method.
  4. Upgrade to the fixed versionDownload and install n8n version 1.123.76, 2.37.7, or 2.38.2 or later, depending on which release line your instance uses. Follow the n8n upgrade guide for your deployment method (Docker, npm, or managed service).
  5. Restart the n8n processStop and start the n8n service to load the new code. For Docker: restart the container. For npm: stop the process and run it again. For managed services: trigger a restart through the console.
  6. Verify the fix is in placeLog in to the n8n UI and confirm the version shown in the footer matches the fixed version you installed (1.123.76, 2.37.7, or 2.38.2 or later).
  7. Review workflow history for suspicious changesCheck the audit log or workflow version history for unusual edits or new workflows created before the upgrade. Look for workflows with expressions that contain class field names or unusual syntax.
  8. Check for signs of prior exploitationReview n8n logs and system logs for unusual process execution, network connections, or file access during the period before the upgrade. If suspicious activity is found, treat the instance as compromised and investigate further.

How to confirm it is fixed: Log in to the n8n UI and confirm the version shown in the settings or footer matches 1.123.76, 2.37.7, 2.38.2, or later.

SecurityElites Quick Fixes: copy and paste

Upgrade n8n with npmupgrade

npm install n8n@2.38.2
npm ls n8n

Check n8n version (Docker)for this issue

docker inspect <container_id> | grep -A 2 'n8n'

Check n8n version (npm install)for this issue

npm list n8n

Run the service in a locked-down containergeneral hardening

docker run --read-only --cap-drop ALL \
  --security-opt no-new-privileges --user 1000:1000 \
  -p 127.0.0.1:8080:8080 YOUR_IMAGE

Test in a non-production environment first. General hardening examples use placeholder names and ports; change them to match your setup.

Let your AI coding assistant do the upgrade

Paste this into the coding assistant you already use, inside the project. It checks first and asks before it changes anything.

Instruction for your coding assistant

You are helping me fix a security vulnerability (CVE-2026-86076) in this project.\n\n1. Search the whole repository, including lock files, container files and CI configuration, for these packages and list every place they are pinned or installed:\n   - n8n (npm): must be 2.38.2 or later
2. Tell me which version we use now and whether it is affected. Stop and ask me before changing anything.
3. After I agree, raise each one to the safe version, update the lock files, and keep every other dependency as it is.
4. Run the tests and tell me what failed.
5. Give me a short summary of the files you changed that I can put in the pull request.

SecurityElites Incident Drill: could your team handle this?

Four questions to ask in your next team meeting. If any has no clear answer, that is the gap to close.

What versions of n8n are safe from this vulnerability?A good answer: 1.123.76 or later in the 1.x line, 2.37.7 or later in the 2.0–2.37 line, and 2.38.2 or later in the 2.38+ line.
Who can exploit this vulnerability and what can they do?A good answer: Anyone with permission to create or edit workflows can run arbitrary code in the n8n backend process or in the browser session of someone who opens their workflow.
What is the temporary workaround if we cannot upgrade immediately?A good answer: Restrict n8n access to only fully trusted users, block workflow create and edit permissions for untrusted users, and optionally set the environment variable N8N_EXPRESSION_ENGINE=vm (which provides partial mitigation but does not fully fix
What should we check to see if this was used against us before we patched?A good answer: Review n8n audit logs for unexpected workflow edits, check system logs for suspicious child processes spawned by n8n, and audit existing workflows for unusual expressions with class field names or reserved keywords.

Run a full timed drill with your team

Ticket for your backlog

Paste into Jira, GitHub Issues or any tracker that reads Markdown.

Ready-made ticket

## n8n expression compiler can run arbitrary code through class field names (CVE-2026-86076)

**Severity:** High  |  **SE Fix-First Score:** 43/100  |  **Fix window:** Within 30 days
**Record:** SE-AIV-01786 https://securityelites.com/ai-vulnerabilities/cve-2026-86076-n8n-expression-compiler-can-run-arbitrary-code-through-class/

### Why this matters
An attacker with workflow create or edit access can run code as the n8n process on the backend, or in the browser of anyone who opens a workflow. This can steal credentials, modify workflows, access data processed by n8n, or take over the account.

### What to do
1. Find all n8n instances in your environment
2. Check the version of each n8n instance
3. Back up the n8n database
4. Upgrade to the fixed version
5. Restart the n8n process
6. Verify the fix is in place
7. Review workflow history for suspicious changes
8. Check for signs of prior exploitation

Full steps: https://securityelites.com/ai-vulnerabilities/cve-2026-86076-n8n-expression-compiler-can-run-arbitrary-code-through-class/

### Done when
- [ ] n8n is at 2.38.2 or later everywhere it is installed
- [ ] Lock files, container images and CI configuration are updated
- [ ] Log in to the n8n UI and confirm the version shown in the settings or footer matches 1.123.76, 2.37.7, 2.38.2, or later.
- [ ] Logs were checked for signs of earlier use

SecurityElites Fix Tracker

Record who owns this fix, the date it is due and when it is done, and see everything still open in one list. Free with a SecurityElites account.

Sign in to track this fix

Change history

  • 10 Sep 2026: Made public
  • 2 Dec 2026: Published

Official record

## ImpactThe 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.## PatchesThe 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.## WorkaroundsIf 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.

Weakness type: CWE-94

Use this record in your own tools

Get this record as JSON

curl https://securityelites.com/wp-json/se-aivd/v1/vulns/CVE-2026-86076

For scanners and pipelines: OSV format · CycloneDX format · API guide · Email alerts · Fix tracker

The plain-language sections were written with AI from the official record, and the upgrade versions come directly from the official data. Last updated 2 Dec 2026. Read the vendor advisory before changing a production system.