n8n Merge node can write arbitrary files, allowing code execution

CriticalSE Fix-First Score 51/100CVE-2026-25056SE-AIV-01784Reading or writing files it should notAI apps and chat interfacesMade public 5 Feb 2026

Download as PDF

What this means

An attacker with permission to create or edit workflows could write malicious files to the n8n server and run code on it. This could expose all data the server can access, disrupt service, or be used as a stepping stone to attack other systems.

SecurityElites Manager Brief: the decision in one minute

A feature in n8n lets someone who can edit workflows write files and run code on your server. You need to upgrade now. If you can't upgrade today, block who can edit workflows and disable the Merge node.

SecurityElites Fix-First Score51 of 100
Our own ranking of what to fix first. Real attacks count most, then the chance of attack, then severity.
SecurityElites fix windowWithin 7 days
Critical severity. This is our suggestion from common practice; your own policy comes first.
Who should own the fixPlatform or infrastructure team responsible for n8n deployments.
Likely effortAbout 15 to 30 minutes to upgrade and restart n8n; longer if you have many self-hosted instances or need to test first. Rolling back a workflow change could take additional time if someone has already added malicious code.

Questions to ask your team or supplier

  • Who currently has permission to create and edit workflows, and have we verified all of them are trustworthy?
  • Do we have a process to review workflow changes before they go live, and if not, should we implement one?
  • If this vulnerability was exploited in our environment, would we detect unusual file writes or workflow modifications in our logs?

Message you can forward to the owning team

Security notice: n8n Merge node can write arbitrary files, allowing code execution (CVE-2026-25056)

Severity: Critical
SecurityElites Fix-First Score: 51 of 100
SecurityElites fix window: Within 7 days
Action: upgrade to n8n 2.4.0 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-25056-n8n-merge-node-can-write-arbitrary-files-allowing-code/
Source: SecurityElites AI Vulnerabilities Database, record SE-AIV-01784

What is at stake in your AI setup

  • Workflows and automation logic could be rewritten or poisoned to steal or corrupt data flowing through n8n integrations.
  • Credentials and API keys stored in n8n (for external AI services, databases, or APIs) could be exfiltrated or used to access downstream systems.
  • Custom tools and connections an agent workflow depends on could be compromised or redirected to malicious endpoints.
  • Training or retrieval data accessible to workflows or integrations could be read, modified, or exfiltrated.

Map where your company uses AI

Who is exposed

  • n8n instances running version 1.117.x or earlier
  • n8n instances running version 2.0.0 to 2.3.x
  • Teams with broad workflow editor permissions (risk increases if editors are not fully trusted)
  • Servers where n8n runs with high system privileges or access to sensitive data

Upgrades you need

SoftwareAffected versionsMove to
n8n
npm
Every version before 1.118.0; 2.0.0 up to, but not including, 2.4.02.4.0 or later

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

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:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H

Kind of coding mistake

  • CWE-434: dangerous files can be uploaded
  • CWE-693

If you cannot upgrade today

  • Restrict workflow creation and editing to fully trusted users only until you can upgrade.
  • Disable the Merge node globally using n8n's node blocking feature (see n8n documentation on blocking nodes) if it is not essential.
  • Review all existing workflows for Merge nodes in SQL Query mode and remove or disable them if not in active use.

Signs it may already have been used against you

  • Check workflow history or logs for Merge nodes added or edited in the last 30 days, especially with SQL Query mode enabled.
  • Search logs for unusual file write operations from the n8n process, such as files written outside the normal data directory.
  • Review audit logs for workflow changes made by users who don't normally edit workflows, or during unusual hours.
  • Look for new or unexpected files in the n8n server's filesystem, particularly in `/etc`, `/var`, or directories where the n8n process runs.

SecurityElites Fix Guide: step by step

  1. Find all n8n installationsList every server or container running n8n. Include self-hosted, on-premises, and any cloud deployments your company controls. Note which version each one is running.
  2. Check which versions need upgradeAny version before 1.118.0 is vulnerable. Any version from 2.0.0 to 2.3.x (inclusive) is vulnerable. Versions 1.118.0 and later, and 2.4.0 and later, are safe.
  3. Review workflow editor permissions nowList everyone who can create or edit workflows. If any person is not fully trusted or their account could be compromised, they pose a risk. Write this list down for step 6.
  4. Back up the n8n database and configExport the workflow definitions, credentials, and configuration. This lets you recover if something goes wrong and helps you check for malicious workflows later.
  5. Upgrade n8n to the fixed versionFor instances on 1.x: upgrade to 1.118.0 or later. For instances on 2.x: upgrade to 2.4.0 or later. Follow n8n's official upgrade steps for your deployment method (Docker, npm, managed cloud, etc.).
  6. Restart n8n and confirm it startsAfter upgrade, restart the n8n service. Wait for it to come online and confirm you can log in and see your workflows.
  7. Review recent workflows for suspicious changesUsing the backup from step 4, compare the current workflows against the backup. Look for any Merge nodes using SQL Query mode that were added or changed recently, especially by users on your list from step 3. Flag anything unusual.
  8. Tighten workflow permissions if neededIf your earlier review found risky editors, now restrict who can create or edit workflows. Require approval for workflow changes or limit editors to a smaller trusted group.

How to confirm it is fixed: Confirm that all n8n instances are running version 1.118.0 or later (on the 1.x branch) or version 2.4.0 or later (on the 2.x branch).

SecurityElites Quick Fixes: copy and paste

Upgrade n8n with npmupgrade

npm install n8n@2.4.0
npm ls n8n

Check n8n version via API (requires authentication)for this issue

curl -s -H 'X-N8N-API-KEY: your_api_key' http://localhost:5678/api/v1/health | grep -i version

List all Merge nodes in workflows (n8n CLI, requires installation)for this issue

n8n export:workflows --output=workflows.json && grep -i 'merge' workflows.json | head -20

Keep file access inside one directory (Python)general hardening

from pathlib import Path

BASE = Path("/srv/app/data").resolve()

def safe_path(name: str) -> Path:
    p = (BASE / name).resolve()
    if not p.is_relative_to(BASE):
        raise ValueError("path outside allowed directory")
    return p

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-25056) 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.4.0 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.

Which two versions of n8n are currently safe from this issue?A good answer: Version 1.118.0 and later on the 1.x branch, and version 2.4.0 and later on the 2.x branch.
What is the main risk if someone with workflow editing permission is compromised or is malicious?A good answer: They could use the Merge node to write files to the server and run code, potentially accessing all data and disrupting service.
What should you do immediately if you cannot upgrade n8n right now?A good answer: Restrict who can create and edit workflows to only fully trusted people, and consider disabling the Merge node entirely.
What evidence should you look for to see if this vulnerability was used against your n8n server?A good answer: Unexpected file writes on the server, Merge nodes with SQL Query mode added recently, or workflows changed by unusual users.

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 Merge node can write arbitrary files, allowing code execution (CVE-2026-25056)

**Severity:** Critical  |  **SE Fix-First Score:** 51/100  |  **Fix window:** Within 7 days
**Record:** SE-AIV-01784 https://securityelites.com/ai-vulnerabilities/cve-2026-25056-n8n-merge-node-can-write-arbitrary-files-allowing-code/

### Why this matters
An attacker with permission to create or edit workflows could write malicious files to the n8n server and run code on it. This could expose all data the server can access, disrupt service, or be used as a stepping stone to attack other systems.

### What to do
1. Find all n8n installations
2. Check which versions need upgrade
3. Review workflow editor permissions now
4. Back up the n8n database and config
5. Upgrade n8n to the fixed version
6. Restart n8n and confirm it starts
7. Review recent workflows for suspicious changes
8. Tighten workflow permissions if needed

Full steps: https://securityelites.com/ai-vulnerabilities/cve-2026-25056-n8n-merge-node-can-write-arbitrary-files-allowing-code/

### Done when
- [ ] n8n is at 2.4.0 or later everywhere it is installed
- [ ] Lock files, container images and CI configuration are updated
- [ ] Confirm that all n8n instances are running version 1.118.0 or later (on the 1.x branch) or version 2.4.0 or later (on the 2.x branch).
- [ ] 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

  • 4 Feb 2026: Made public
  • 2 Dec 2026: Published

Official record

## ImpactA vulnerability in the Merge node's SQL Query mode allowed authenticated users with permission to create or modify workflows to write arbitrary files to the n8n server's filesystem potentially leading to remote code execution.## PatchesThe issue has been fixed in n8n version 2.4.0, 1.118.0. Users should upgrade to this version or later to remediate the vulnerability.## WorkaroundsIf upgrading is not immediately possible, administrators should consider the following temporary mitigations:- Limit workflow creation and editing permissions to fully trusted users only. - Disable or restrict use of the Merge node if not essential for operations. - Review workflows for suspicious use of the Merge node's SQL Query mode.These workarounds do not fully remediate the risk and should only be used as short-term mitigation measures.## **Resources**- [n8n Documentation — Blocking nodes](https://docs.n8n.io/hosting/securing/blocking-nodes/) — how to globally disable specific nodes--- n8n has adopted CVSS 4.0 as primary score for all security advisories. CVSS 3.1 vector strings are provided for backwards compatibility.CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H

Weakness type: CWE-434, CWE-693

Use this record in your own tools

Get this record as JSON

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

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.