n8n Merge node can write arbitrary files, allowing code execution
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 Score | 51 of 100 Our own ranking of what to fix first. Real attacks count most, then the chance of attack, then severity. |
|---|---|
| SecurityElites fix window | Within 7 days Critical severity. This is our suggestion from common practice; your own policy comes first. |
| Who should own the fix | Platform or infrastructure team responsible for n8n deployments. |
| Likely effort | About 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-01784What 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.
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
| Software | Affected versions | Move to |
|---|---|---|
| n8n npm | Every version before 1.118.0; 2.0.0 up to, but not including, 2.4.0 | 2.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 attacked | No known attacks and no public attack code when CISA last reviewed it |
|---|---|
| Where the attacker must be | Anywhere that can reach it over a network, including the internet if it is exposed |
| Account needed | An ordinary user account |
| Does a person have to do something | No. It works without anyone clicking or opening anything |
| How hard it is to do | Easy. It works reliably once the attacker can reach it |
| Risk of: data being read | High |
| Risk of: data or settings being changed | High |
| Risk of: the service being taken down | High |
| Can attackers automate it at scale | No, according to CISA. Each target needs manual work |
| How much control an attacker gains | Total 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
- 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.
- 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.
- 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.
- 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.
- 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.).
- 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.
- 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.
- 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 n8nCheck 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 versionList all Merge nodes in workflows (n8n CLI, requires installation)for this issue
n8n export:workflows --output=workflows.json && grep -i 'merge' workflows.json | head -20Keep 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 pTest 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.
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.
Related vulnerabilities
In the same software
- n8n legacy expression engine allows code execution via JSON.stringify override High · CVE-2026-86083
- n8n OpenAI node bypasses domain restrictions on model search High · CVE-2026-86082
- n8n Git node can freeze the instance with a crafted path High · CVE-2026-86081
- n8n OAuth registration accepts unlimited field sizes, filling the database High · CVE-2026-86075
- n8n expression compiler can run arbitrary code through class field names High · CVE-2026-86076
- n8n Edit Fields node can crash the whole instance with a bad field name High · CVE-2026-72749
The same kind of mistake in other AI tools
- Nik Voice Ticketing AI allows upload and run of harmful files without login Critical · CVE-2026-143966
- NLTK can write files outside its data directory through hardlinks during package extraction High · CVE-2026-128135
- MLflow can read files it should not when creating prompt model versions High · CVE-2026-116690
- LiteLLM proxy can be made to read local files by authenticated users High · GHSA-g5ff-637f-6q2m
- MLflow can write files outside the trace directory via crafted trace ID High · CVE-2026-53995
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-25056For 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.