Skip to content
RCE Write-up Advanced

CVE Decoded #1: CVE-2026–1470 (n8n)

A sandbox escape in n8n's Code node allowed an attacker to break out of the restricted JavaScript environment and execute operating system commands on the server. This gave full control of the host and access to all stored credentials.

medium.com

Published on medium.com

Cve

Saijalpreet Kaur, on medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 5 min read.

Context

CVE-2026-1470 is a sandbox escape leading to remote code execution in n8n, an open-source workflow automation tool. n8n acts as a digital middleman: it connects different apps so they can share information automatically. For example, an order arriving by email can be reflected in a team Slack channel by describing the flow to n8n. Because n8n is open source, many companies run it on their own private servers rather than relying on a cloud service.

The vulnerable feature is the Code node. When the built-in integrations are not enough, users can write custom JavaScript to process data. To keep this safe, n8n runs user code inside a sandbox, a restricted environment that prevents the code from accessing the underlying server. The report describes the sandbox as a glass tupperware in a fridge: nothing can touch what is inside it, and it cannot touch the fridge. In this case, somebody figured out how to melt that glass.

The basic details given for the CVE are:

Field Value
CVE ID CVE-2026-1470
Published January 27, 2026
Severity Critical, CVSS score 9.9
Affected software n8n
Platform Open Source
Vulnerability type Sandbox Escape / RCE
From the original on medium.com

Setup

When n8n executes custom JavaScript in a Code node, it uses a built-in Node.js feature to isolate the code. The report describes two ways in: access to an exposed n8n dashboard, or an account with permission to edit n8n. The report does not describe a specific lab, version, account or tooling beyond this.

Finding it

The starting point is the Code node and its sandbox. The observation is that attackers found a way to manipulate JavaScript's core objects and prototypes from inside the sandbox. By passing specially crafted code to the Code node, an attacker could trick the JavaScript engine into handing over a reference to the main server process running outside the sandbox.

The report states that no public proof of concept has been released for this specific CVE, but that the vulnerability is a Node.js sandbox escape and that this class of attack is well documented.

From the original on medium.com

Exploitation

The report describes the escape in three conceptual steps, followed by the attack sequence against a target.

Step 1: climb the constructor chain

In JavaScript, every piece of data, a number, a word or a list, is built by something called a constructor. The report compares a constructor to a factory machine: the number 5 was built by one machine, the word hello by a different machine. The key point is that the machines themselves were also built by a machine, a master machine that builds all the other machines.

The attacker asks, in effect, who built you, then who built that, and by climbing up the chain reaches the master machine, the one with the power to create anything.

Step 2: obtain process

With the master machine in hand, the attacker tells it to build something that gives access to process. The report describes process as the brain of the server, the thing that controls the entire computer n8n is running on. It is absolutely not supposed to be accessible from inside the sandbox, but the master machine is too powerful and simply obeys: it reaches outside the sandbox, grabs process, and hands it to the attacker. The analogy used is a prisoner in the sandbox convincing the warden to hand over the master key.

Step 3: run operating system commands

With the brain of the server, the attacker can talk directly to the computer's operating system. The report gives one example command:

Bash
cat /etc/passwd

This Linux command reads the file containing all the user accounts on the server. The attacker could replace it with any command: download malware, steal database passwords, or open a permanent back door. The sandbox is gone.

The report summarises the whole chain as n8n putting dangerous code in a secure room but leaving a tiny crack under the door; the attacker slides a piece of paper under the door, asks the master guard (the constructor) to sign it, and uses that signature to take over the entire building.

The attack, step by step

  1. Gain access to n8n. The attacker scans the internet for exposed n8n dashboards that do not require a strong password. A person inside with permission to edit n8n can also do this.
  2. Add a malicious Code node. They create a simple workflow with a single Code node, pasting in the four lines of JavaScript described above.
  3. Execute the workflow. They click 'Test workflow', and n8n tries to run it safely inside the sandbox.
  4. Take control. The code uses the constructor trick to escape the sandbox, executes the OS command, and hands the attacker full control of the server.

The report refers to the payload as four lines of JavaScript but does not reproduce them.

Root cause

The isolation relies on a built-in Node.js feature, and the code inside the sandbox can still reach JavaScript's core objects and prototypes. From there, the constructor chain leads to a reference to the main server process outside the sandbox. The report says the maintainers patched the issue by hardening the sandbox implementation and restricting access to the vulnerable JavaScript objects. The report does not give the specific code change, so the exact mechanism by which the prototype manipulation yielded process is not stated.

Impact

A successful escape gives the attacker complete control of the server running n8n. Sandbox escapes are always serious, but the report argues they are especially damaging in workflow automation tools, because a tool like n8n is designed to hold a company's secrets. To do its job, n8n needs API keys for a CRM, passwords for databases and access tokens for cloud infrastructure. An attacker who takes over the n8n server gets all of those credentials, a skeleton key to the entire digital operation.

Anyone running a self-hosted instance of n8n exposed to untrusted users is affected. The report states that the vulnerability was used in real attacks: attackers quickly began scanning for exposed n8n instances.

Fix

The maintainers of n8n patched the vulnerability quickly by hardening the sandbox implementation and restricting access to the vulnerable JavaScript objects. The report recommends the following for operators:

  • Update immediately to the latest secure version of n8n.
  • Restrict dashboard access. Never leave the n8n dashboard open to the public internet without strong authentication, and ideally put it behind a VPN.
  • Audit users. Check who has permission to create or edit workflows in the n8n instance.
  • Rotate secrets. Assume every API key and password stored in n8n is in the hands of attackers and change them all.

Variants to test

The report's own resources for further reading are the NIST NVD entry for CVE-2026-1470, the n8n security advisories page, and a write-up on Node.js sandbox escape techniques.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 12 min read.

What happened, in plain words

A piece of software called n8n had a serious security bug. n8n is a tool that companies use to make different apps talk to each other automatically. It lets people write small pieces of code to process data, and it promises to run that code in a safe, sealed-off area so the code cannot harm the rest of the computer. Someone found a way to break out of that sealed area and take control of the whole server. The bug was given the name CVE-2026-1470, and the maintainers of n8n patched it.

This article walks through what that means, one idea at a time. You do not need to know how to program. If you can use a browser, you can follow along.

What is a CVE?

CVE stands for Common Vulnerabilities and Exposures. It is simply a naming system for security bugs. Somebody finds a flaw in a piece of software, and the flaw gets a CVE ID, like a roll number at school: CVE, then the year, then a unique number. Having a shared name means everyone, everywhere, can talk about the same bug without confusion.

The basic details

Field Value
CVE ID CVE-2026-1470
Published January 27, 2026
Severity Critical, CVSS score 9.9
Affected software n8n
Platform Open Source
Vulnerability type Sandbox Escape / RCE

A few of those words need unpacking.

Severity and CVSS. CVSS is a scoring system for how bad a security bug is. Scores run from 0 to 10, and higher is worse. A 9.9 is near the top of the scale, which is why the severity is listed as Critical.

Open Source. This means the underlying code is publicly available for anyone to read, use and improve. Because of that, many companies choose to run n8n on their own private servers instead of paying a cloud service to run it for them.

Sandbox Escape / RCE. A sandbox is a restricted area that code is run inside, so that even if the code misbehaves it cannot reach the rest of the computer. A sandbox escape is a way of getting out of that area. RCE stands for Remote Code Execution: the ability for an attacker, working remotely over the internet, to make the server run commands of their choosing. Put together, the bug lets an attacker get out of the safe area and run their own commands on the server.

From the original on medium.com

What is n8n?

n8n is an open-source workflow automation tool. The easiest way to picture it is as a digital middleman. It connects different apps together so they can automatically share information.

Say you want an order that arrives by email to also appear in your team's Slack channel. You describe that flow to n8n, and n8n does it for you, every time, without anyone copying and pasting by hand. Developers and companies use it to build complicated chains of automation.

Because n8n is open source, many companies run it on their own private servers rather than relying on a cloud service. That detail matters later: it means the server holding the company's data is the company's own machine.

The feature at the centre of it: the Code node

n8n comes with ready-made building blocks that connect to common apps. When those built-in integrations are not enough, a user can write custom JavaScript to process data. JavaScript is the programming language that runs inside web pages, and it is also used on servers. The place where this custom code is written is called a Code node. A node is simply one step in a workflow.

Running a stranger's code on your server sounds reckless, so n8n takes a precaution. It runs user code inside a sandbox: a restricted environment that prevents the code from accessing the underlying server.

The report uses a homely comparison. Think of the sandbox as a glass tupperware box in a fridge. Nothing can touch what is inside the box, and what is inside the box cannot touch the fridge. In this case, somebody figured out how to melt that glass.

The real stuff: what the bug actually is

This vulnerability is a sandbox escape leading to Remote Code Execution.

In one line: a hacker could break out of the restricted safe zone in n8n and take complete control of the server running the software.

When n8n executes custom JavaScript in a Code node, it uses a built-in Node.js feature to isolate the code. Node.js is a program that lets JavaScript run outside a browser, on a server. The isolation is supposed to keep the code contained.

Attackers discovered a clever way to manipulate JavaScript's core objects and prototypes from inside the sandbox. Those two words, objects and prototypes, are the heart of the trick, and the next section explains them from scratch.

By passing specially crafted code to the n8n Code node, an attacker could trick the JavaScript engine into handing over a reference to the main server process running outside the sandbox. A reference here means a handle or a pointer: not a copy of the thing, but a way to reach and use the real thing.

No public proof-of-concept has been released for this specific CVE. A proof-of-concept is a working demonstration that shows the bug can really be exploited. Even without one, the vulnerability involves a Node.js sandbox escape, and this class of attack is well documented.

How these escapes typically work

From the original on medium.com

The report explains the escape in three conceptual steps. Before the steps, one piece of background is needed.

In JavaScript, every piece of data, a number, a word or a list, is built by something called a constructor. Think of a constructor as a factory machine. The number 5 was built by one machine. The word hello was built by a different machine.

Now the important part: the machines themselves were also built by a machine. There is a master machine, the one that builds all the other machines. If you can reach the master machine, you can ask it to build anything.

Step 1: climb the constructor chain

The attacker asks, in effect: who built you? And then: who built that? By climbing up the chain of builders, they reach the master machine, the one with the power to create anything.

Why do this? Because the sandbox is meant to stop the code from reaching anything outside. The attacker climbs the constructor chain to reach the master machine, the one with the power to create anything.

Step 2: obtain process

Now the attacker has the master machine. They tell it: build me something that gives me access to process.

What is process? It is the brain of the server. It is the thing that controls the entire computer n8n is running on. It is absolutely not supposed to be accessible from inside the sandbox. But the master machine does not know that. It is too powerful, and it simply obeys. It reaches outside the sandbox, grabs process, and hands it to the attacker.

The report's comparison: it is like being a prisoner inside the sandbox and convincing your warden to hand over the master key, as though you were supposed to have it all along.

Step 3: run operating system commands

With the brain of the server in hand, the attacker can talk directly to the computer's operating system. The report gives one example command:

Bash
cat /etc/passwd

Line by line, in plain words:

  • cat is a Linux command that prints the contents of a file to the screen.
  • /etc/passwd is the path to a file on the server. On Linux, this file lists the user accounts on the machine. The leading slash means the path starts from the very top of the file system.
  • Together, the command reads the file containing all the user accounts on the server.

The attacker could replace it with any command at all: download malware, steal database passwords, or open a permanent back door. But the attacker could replace it with any command at all: download malware, steal database passwords, or open a permanent back door. The sandbox is gone, and they are free.

The simplest way to put it

n8n put the dangerous code in a secure room, but accidentally left a tiny crack under the door. The attacker used a trick to slide a piece of paper under the door, asked the master guard (the constructor) to sign it, and used that signature to take over the entire building.

The attack, step by step

  1. Gain access to n8n. The attacker scans the internet for exposed n8n dashboards that do not require a strong password. A person already inside the company, with permission to edit n8n, can also do this. Scanning the internet means using automated tools to check many addresses for a particular service that answers.
  2. Add a malicious Code node. They create a simple workflow with a single Code node, pasting in the four lines of JavaScript described above. The report refers to the payload as four lines of JavaScript but does not reproduce them.
  3. Execute the workflow. They click 'Test workflow', and n8n tries to run it safely inside the sandbox.
  4. Take control. The code uses the constructor trick to escape the sandbox, executes the operating system command, and hands the attacker full control of the server.

How bad is it, really?

Sandbox escapes are always a big deal, but they are especially damaging in workflow automation tools.

Why? Because a tool like n8n is designed to hold a company's secrets. To do its job, n8n needs API keys for a CRM, passwords for databases, and access tokens for cloud infrastructure. An API key is a long secret string that lets one program prove to another program that it is allowed in, much like a password, but for software rather than a person. A CRM is customer relationship management software, where a company keeps its customer records. An access token is a similar secret that grants access to a service.

If an attacker takes over the n8n server, they get access to all of those credentials. It is a skeleton key to the entire digital operation.

Who is affected? Anyone running a self-hosted instance of n8n exposed to untrusted users. Self-hosted means the company runs the software on its own machine rather than on someone else's cloud.

Was it used in real attacks? Yes. Attackers quickly began scanning for exposed n8n instances.

The fix

The maintainers of n8n patched this vulnerability quickly by hardening the sandbox implementation and restricting access to the vulnerable JavaScript objects. Hardening means making the protective layer stronger and less permissive.

For anyone running n8n, the report recommends four things:

  • Update immediately to the latest secure version of n8n.
  • Restrict dashboard access. Never leave the n8n dashboard open to the public internet without strong authentication, and ideally put it behind a VPN. A VPN is a private tunnel between a computer and a network, so the dashboard is reachable only from inside.
  • Audit users. Check who has permission to create or edit workflows in the n8n instance. Check who has permission to create or edit workflows in the n8n instance.
  • Rotate secrets. Assume every API key and password stored in n8n is now in the hands of attackers, and change them all. Rotating means replacing old secrets with new ones.

What I learned from this one

This CVE opened my eyes to the illusion of safety. When a tool explicitly says it runs code in a sandbox, I had always assumed that meant safe. But a sandbox is just software, and software has bugs. A feature designed to be secure is not automatically impervious.

It also highlighted the risk of hub applications. We spend a lot of time securing our individual apps, but we willingly plug all their API keys into a central automation hub like n8n. If that hub falls, the whole network falls with it. Convenience and security are always pulling in opposite directions.

Where to read more

Glossary

  • API key: a long secret string that lets one program prove to another that it is allowed in, like a password for software.
  • Access token: a secret that grants a program access to a service, similar in purpose to an API key.
  • Constructor: in JavaScript, the thing that builds a piece of data, such as a number or a word. The report compares it to a factory machine.
  • CRM: customer relationship management software, where a company keeps its customer records.
  • CVSS: a scoring system for the severity of a security bug, from 0 to 10, where higher is worse.
  • CVE: Common Vulnerabilities and Exposures, a naming system that gives each publicly known security bug a unique ID.
  • Code node: the step in an n8n workflow where a user can write custom JavaScript to process data.
  • Dashboard: the web interface where a user logs in to n8n and builds workflows.
  • Hardening: making a protective layer stronger and less permissive.
  • Hub application: a central tool that holds the keys and connections for many other apps, so that if it falls, everything connected to it is exposed.
  • JavaScript: the programming language used inside web pages and also on servers.
  • Node.js: a program that lets JavaScript run outside a browser, on a server.
  • Node: one step in an n8n workflow.
  • n8n: an open-source workflow automation tool that connects apps so they share information automatically.
  • Open source: software whose underlying code is publicly available to read, use and improve.
  • Operating system: the core software that controls a computer, such as Linux.
  • process: in Node.js, the object that represents and controls the running server program. The report calls it the brain of the server.
  • Proof-of-concept: a working demonstration that a security bug can really be exploited.
  • Prototype: in JavaScript, the shared template that objects inherit behaviour from. Manipulating prototypes is the route used in this escape.
  • RCE (Remote Code Execution): the ability for an attacker working over the internet to make a server run commands of their choosing.
  • Reference: a handle that lets code reach and use a real object, rather than a copy of it.
  • Rotate: replace old secrets, such as passwords and keys, with new ones.
  • Sandbox: a restricted environment that code is run inside so it cannot reach the rest of the computer.
  • Sandbox escape: a way of getting out of a sandbox and reaching the underlying system.
  • Self-hosted: software run on a company's own machine rather than on someone else's cloud service.
  • Severity: how serious a security bug is, often expressed as a CVSS score.
  • VPN: a private tunnel between a computer and a network, so a service is reachable only from inside.
  • Workflow: a chain of steps in n8n that runs automatically to move or process data.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.