n8n workflow expressions can run code with full server access

HighSE Fix-First Score 43/100CVE-2026-65591SE-AIV-01813Other weaknessAI apps and chat interfacesMade public 23 Jul 2026

Download as PDF

What this means

An authenticated person with permission to create or change workflows can run code as the n8n process, gaining full control of the server. This can lead to data theft, system compromise, ransom attacks, or use of the server for further attacks.

SecurityElites Manager Brief: the decision in one minute

n8n has a code execution flaw in its expression system that lets authorized users run arbitrary code on your server. You must upgrade immediately or restrict access to trusted users only until you can patch.

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 upgrades.
Likely effortAbout 15 to 30 minutes to upgrade and restart: a version bump and restart of n8n. Longer if you have many workflows to validate afterward or need to coordinate across multiple n8n instances.

Questions to ask your team or supplier

  • Who in your organization has permission to create or modify workflows in n8n, and do all of them need that access?
  • Do you have any way to know if someone created or ran an unauthorized workflow in n8n between now and when the last n8n upgrade was applied?

Message you can forward to the owning team

Security notice: n8n workflow expressions can run code with full server access (CVE-2026-65591)

Severity: High
SecurityElites Fix-First Score: 43 of 100
SecurityElites fix window: Within 30 days
Action: upgrade to n8n 2.30.1 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-65591-n8n-workflow-expressions-can-run-code-with-full-server/
Source: SecurityElites AI Vulnerabilities Database, record SE-AIV-01813

What is at stake in your AI setup

  • Workflows and their configuration: an attacker could read, modify, or delete workflows, including those that interact with AI services or handle sensitive data
  • Credentials and API keys: code execution allows theft of stored credentials for AI providers, databases, and external services connected to n8n
  • Execution data: workflow run logs and intermediate data could be exfiltrated, including prompts, model outputs, and training data processed by workflows

Map where your company uses AI

Who is exposed

  • n8n instances with version 1.x before 1.123.64
  • n8n instances with version 2.0.0-rc.0 through 2.29.7
  • n8n instances with version 2.30.0
  • Teams with workflow create or modify permissions

Upgrades you need

SoftwareAffected versionsMove to
n8n
npm
Every version before 1.123.64; 2.30.0 up to, but not including, 2.30.1; 2.0.0-rc.0 up to, but not including, 2.29.82.30.1 or later

Each maintained branch has its own fixed version. Stay on your branch if you cannot jump to the newest: n8n 1.123.64, 2.29.8, 2.30.1.

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:H/SA:L

Kind of coding mistake

  • CWE-917

If you cannot upgrade today

  • Until you can upgrade, restrict n8n access to users you fully trust and who have a business need to create or modify workflows.
  • Set the environment variable `N8N_EXPRESSION_ENGINE=vm` before starting n8n to switch from the legacy expression engine to the safer VM-based engine. This reduces but does not fully eliminate the risk.

Signs it may already have been used against you

  • Review n8n workflow execution logs for workflows created or executed by users with workflow modify permissions, especially those using expressions or code nodes
  • Check n8n audit logs (if available) for workflow creation or modification events shortly before the vulnerability was patched
  • Look for unexpected workflows that use the legacy expression evaluator to access computed properties or run unusual code
  • Monitor host-level process and network activity from the n8n process around times when workflows were executed, looking for unexpected shell commands or network connections

SecurityElites Fix Guide: step by step

  1. Find your n8n versionLog into your n8n instance. Go to Settings or Administration and find the version number. Write it down.
  2. Check if you are affectedCompare your version to the affected list: before 1.123.64 in the 1.x line, 2.0.0-rc.0 through 2.29.7, or exactly 2.30.0. If your version matches, you are affected.
  3. Review workflow permissionsList all users who have permission to create or modify workflows in n8n. These users could potentially exploit this flaw. Identify any who should not have this access.
  4. Back up your n8n dataExport your workflows, credentials, and configuration before upgrading. If you use a database backend, make a full backup of that database.
  5. Upgrade n8n to a fixed versionUpgrade to version 1.123.64, 2.29.8, or 2.30.1 or later according to your deployment method (npm, Docker, managed service). Follow your infrastructure team's standard upgrade process.
  6. Restart n8nStop the n8n process and start it again to load the new version. Confirm that n8n starts without errors and displays the correct version number in settings.
  7. Verify the fixLog into n8n and confirm the version number now matches or exceeds the fixed versions listed above (1.123.64, 2.29.8, or 2.30.1 or later).
  8. Check for unauthorized workflowsReview your workflow list and execution history for any workflows created or modified since the last time you performed a security audit. Look for workflows that run expressions or code that you do not recognize.

How to confirm it is fixed: Log into n8n, go to Settings, and confirm the version number is 1.123.64 or later (1.x), 2.29.8 or later (2.29.x), or 2.30.1 or later (2.30+).

SecurityElites Quick Fixes: copy and paste

Upgrade n8n with npmupgrade

npm install n8n@2.30.1
npm ls n8n

Check n8n version via APIfor this issue

curl -s http://localhost:5678/api/v1/health | grep -o '"version":"[^"]*"'

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-65591) 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.30.1 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 fixed for this flaw?A good answer: 1.123.64 and later in the 1.x line, 2.29.8 and later in the 2.29 line, or 2.30.1 and later in the 2.30+ line.
Who can exploit this flaw and what do they need permission to do?A good answer: Any authenticated user with permission to create or modify workflows can exploit this flaw to run code as the n8n process.
What is the temporary workaround if we cannot upgrade right now?A good answer: Set N8N_EXPRESSION_ENGINE=vm to use the safer VM engine, and restrict workflow creation or modification permissions to trusted users only.
What data or systems could be compromised if this flaw is exploited?A good answer: An attacker gains full control of the n8n server process, so they can read or steal credentials, modify or delete workflows, access data processed by n8n, and potentially pivot to other systems on your network.

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 workflow expressions can run code with full server access (CVE-2026-65591)

**Severity:** High  |  **SE Fix-First Score:** 43/100  |  **Fix window:** Within 30 days
**Record:** SE-AIV-01813 https://securityelites.com/ai-vulnerabilities/cve-2026-65591-n8n-workflow-expressions-can-run-code-with-full-server/

### Why this matters
An authenticated person with permission to create or change workflows can run code as the n8n process, gaining full control of the server. This can lead to data theft, system compromise, ransom attacks, or use of the server for further attacks.

### What to do
1. Find your n8n version
2. Check if you are affected
3. Review workflow permissions
4. Back up your n8n data
5. Upgrade n8n to a fixed version
6. Restart n8n
7. Verify the fix
8. Check for unauthorized workflows

Full steps: https://securityelites.com/ai-vulnerabilities/cve-2026-65591-n8n-workflow-expressions-can-run-code-with-full-server/

### Done when
- [ ] n8n is at 2.30.1 or later everywhere it is installed
- [ ] Lock files, container images and CI configuration are updated
- [ ] Log into n8n, go to Settings, and confirm the version number is 1.123.64 or later (1.x), 2.29.8 or later (2.29.x), or 2.30.1 or later (2.30+).
- [ ] 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

  • 22 Jul 2026: Made public
  • 2 Dec 2026: Published

Official record

## Impact The legacy expression evaluator's computed-member sanitizer can be bypassed by an authenticated user with workflow create or modify permissions. Successful exploitation grants the attacker host-level code execution as the n8n process.The legacy expression engine is the default engine in affected versions.## Patches The issue has been fixed in n8n versions 1.123.64, 2.29.8, and 2.30.1. 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. - Switch to the non-legacy expression engine by setting `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-917

Use this record in your own tools

Get this record as JSON

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

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.