In short
n8n is a fair-code workflow automation platform that links apps, APIs and AI models in visual workflows, with custom JavaScript or Python code where needed. Teams self-host it or use n8n's cloud. Because it stores credentials for every connected system and can run code, an exposed or unpatched n8n server is a valuable target.
Key takeaways
- What it is
- A workflow automation and AI agent platform with a visual canvas, custom code nodes and hundreds of integrations. It is distributed under the Sustainable Use License and the n8n Enterprise License.
- Why attackers care
- One n8n instance can hold API keys, database passwords and OAuth tokens for many systems, plus a code runtime on the server.
- Known flaws
- NVD lists CVE-2025-68613, an expression-evaluation RCE in CISA's KEV catalog, and CVE-2026-21858, an unauthenticated file read rated 10.0 by GitHub.
- What Odin Research saw
- An inferred attacker working directory of 24 files on a third-party n8n server in Monograph 05, aimed at session forgery, Code node injection and Linux privilege escalation.
- What to do first
- Patch n8n, keep the editor off the internet, block environment access from Code nodes, run task runners in a sandbox and rotate the encryption key after any exposure.
What is n8n?
n8n is a workflow automation platform that connects apps, APIs, databases and AI models in visual workflows, and lets builders add custom JavaScript or Python where needed. Organizations self-host it or use n8n's cloud. It is popular for building AI agents and internal automations.
The project's README calls it a "Fair-code platform to build and deploy AI agents and workflows." It is distributed under the Sustainable Use License and the n8n Enterprise License. The README cites more than 1,500 integrations and 9,000 workflow templates. The repository's About section gives a lower figure of 400 integrations.
n8n is one of the most visible automation projects on GitHub, with about 211,500 stars and 61,600 forks on 21 November 2026. That popularity is a security fact too: attackers study widely deployed software.
n8n is not malicious. It is enterprise middleware, like a SOAR platform or an integration bus. The risk comes from what it holds and what it can run.
How n8n works
- The editor. Users build workflows in a browser canvas. In the README's Docker quick start, the editor runs at
http://localhost:5678. - Nodes and credentials. Each step is a node, such as an HTTP request, a database query or an AI model call. Nodes use stored credentials for the systems they reach.
- Expressions and Code nodes. Expressions fill in values at run time. Code nodes run custom JavaScript or Python. This is where n8n meets the operating system.
- Triggers. Workflows start from triggers. Some, such as forms, accept input from outside users, which is the path CVE-2026-21858 uses.
The documentation lists security controls around these parts. They include SSO, two-factor authentication, encryption key rotation, task runner hardening for Code nodes, execution data redaction, disabling the public API, node blocking and SSRF protection.
The environment variable reference adds settings such as N8N_BLOCK_ENV_ACCESS_IN_NODE, which controls whether expressions and the Code node can read environment variables. N8N_RESTRICT_FILE_ACCESS_TO limits file access to listed directories.
n8n vulnerabilities attackers target
Two recent flaws show why n8n needs fast patching. Both are listed on NVD:
- CVE-2025-68613. A remote code execution flaw in workflow expression evaluation. Expressions that authenticated users supply can run in an insufficiently isolated context, with the privileges of the n8n process. Versions from 0.211.0 up to 1.120.4, and 1.121.0, are affected. Fixes are in 1.120.4, 1.121.1 and 1.122.0. NVD scores it 8.8; GitHub scores it 9.9. CISA added it to the KEV catalog on 11 March 2026.
- CVE-2026-21858. An unauthenticated remote attacker can read files on the server through certain form-based workflows. Versions 1.65.0 up to 1.121.0 are affected, and 1.121.0 fixes it. GitHub rates it 10.0. NVD notes that exposed data may enable further attacks, depending on the deployment.
Read together, the two flaws show a pattern. A file read could expose secrets such as the encryption key, and an expression flaw can turn a low-privilege account into code on the server.
How attackers abuse n8n
An attacker who reaches an n8n instance gets three things at once:
- Credentials. Stored connections to cloud services, databases, mail and chat tools. These are non-human identities that are easy to overlook.
- Code execution. A Code node or expression that calls Node.js system modules runs commands as the n8n process. MITRE tracks malicious JavaScript as T1059.007, under Command and Scripting Interpreter.
- Quiet persistence. A scheduled or webhook workflow is a backdoor that looks like routine automation.
Monograph 05 notes that workstation endpoint tools rarely watch this kind of middleware. That gap is the main reason Odin Research tracks it.
What Odin Research observed
Monograph 05 found 713 unique attacker file paths aimed at enterprise middleware, including Epicor Kinetic, SQL Server Agent, VMware Cloud Director and the n8n and Apache Activiti workflow engines.
- A working directory on a victim server. 24 files sat on a third-party n8n and PostgreSQL server. Scripts that query local databases and a local n8n SQLite store suggest an attacker's working directory, not attacker-owned infrastructure. The report did not confirm this with the owner.
- Session forgery and Code node injection. Three Python scripts are written to forge or replay n8n session tokens, read stored credential rows and patch workflows with JavaScript Code nodes that call system commands.
- A database webshell. A short text file records a PostgreSQL query written to drop a PHP web shell.
- Privilege escalation. Two C sources target Polkit
pkexec(PwnKit, CVE-2021-4034, CVSS 7.8, in CISA KEV since 27 June 2022).
Operating-system command execution on any target was not shown. The server's address, port, paths and hashes are withheld, and the host is on a victim watchlist.
How to detect n8n abuse
- Code node injection on the wire. Monograph 05 publishes Suricata SID 9502607 for a
/workflowsURI carryingn8n-nodes-base.codeandchild_process. It needs TLS offload. - Shells from the workflow runtime. Sigma rule 3 in the report fires when a Java or Node workflow runtime, such as n8n, starts a shell or
curl, excluding npm build scripts. It also catches PwnKit patterns. - Files. The report's YARA rule matches n8n credential or REST strings combined with
child_process. - Audit trails. Run n8n's built-in security audit, and add
auditdEXECVErules on n8n servers. Review new or changed workflows that contain Code nodes.
All rules are on the report page and in the Defense Kit.
How to secure n8n
- Patch quickly. Move past every version affected by CVE-2025-68613 and CVE-2026-21858.
- Keep the editor private. Put it behind SSO or a VPN, require two-factor authentication, and disable the public API if you do not use it.
- Sandbox code. Monograph 05 advises sandboxed task runners and setting
N8N_BLOCK_ENV_ACCESS_IN_NODE=true. Use node blocking for nodes you do not need. - Restrict files and networks. Set
N8N_RESTRICT_FILE_ACCESS_TOand turn on SSRF protection. - Rotate secrets after exposure. Rotate
N8N_ENCRYPTION_KEYand every stored credential, and patch Polkit on the host. Treat workflow imports as code deployments.
n8n compared with other middleware attackers target
| Platform | What runs custom code | Abuse seen in Monograph 05 | Key control |
|---|---|---|---|
| n8n | Code nodes and expressions | Session forgery, Code node injection, PwnKit | Sandboxed task runners, env access blocked |
| Apache Activiti | BPMN script tasks and Groovy | WAF-evading BPMN models | Disable unrestricted Groovy |
| Epicor Kinetic | Business process directives | Directive injection, SQL Agent persistence | Audit directive writes |
| VMware Cloud Director | Appliance services | Exploit workbench with lab markers | Patch and remove public ports |
Frequently asked questions about n8n
What is n8n?
n8n is a fair-code workflow automation platform. It connects apps, APIs, databases and AI models in visual workflows, and supports custom JavaScript and Python code.
Is n8n safe?
n8n is legitimate software. It is safe to run when patched, kept off the public internet and configured with its security controls, such as SSO, two-factor authentication and sandboxed task runners.
Is n8n open source?
n8n describes itself as fair-code. Its source is public, but it is distributed under the Sustainable Use License and the n8n Enterprise License rather than a classic open-source license.
What port does n8n use?
The README's Docker quick start runs the editor at http://localhost:5678.
What is CVE-2025-68613?
It is a remote code execution flaw in n8n's workflow expression evaluation, exploitable by authenticated users. NVD scores it 8.8, and CISA added it to the KEV catalog on 11 March 2026.
What is CVE-2026-21858?
It lets an unauthenticated attacker read files on the n8n server through certain form-based workflows. It affects versions 1.65.0 up to 1.121.0, and GitHub rates it 10.0.
How do attackers abuse n8n?
They steal stored credentials, inject Code nodes that call system commands, and plant workflows as persistence. Odin Research found files built for these steps on a third-party n8n server.
How do I detect n8n abuse?
Watch for the n8n process starting shells or curl, workflow updates that add child_process calls, and unexpected new workflows. Odin Research publishes Suricata, Sigma and YARA rules in Monograph 05.
Sources
- n8n-io, n8n repository, GitHub. github.com/n8n-io/n8n (checked 21 November 2026)
- n8n documentation, Securing n8n. docs.n8n.io/hosting/securing/overview/ (checked 21 November 2026)
- n8n documentation, Security environment variables. docs.n8n.io/hosting/configuration/environment-variables/security/ (checked 21 November 2026)
- NVD, CVE-2025-68613. nvd.nist.gov/vuln/detail/CVE-2025-68613 (checked 21 November 2026)
- NVD, CVE-2026-21858. nvd.nist.gov/vuln/detail/CVE-2026-21858 (checked 21 November 2026)
- NVD, CVE-2021-4034. nvd.nist.gov/vuln/detail/CVE-2021-4034 (checked 21 November 2026)
- MITRE ATT&CK, T1059.007 JavaScript. attack.mitre.org/techniques/T1059/007/ (checked 21 November 2026)
Related tools and terms
What is Epicor Kinetic?
Epicor Kinetic is an enterprise resource planning (ERP) suite for manufacturers and distributors. Its business process management (BPM) directives can run custom code inside the ERP.
Enterprise softwareWhat is VMware Cloud Director?
VMware Cloud Director is a multi-tenant cloud management platform that service providers use to run virtual data centres for customers.
Enterprise softwareWhat is VMware ESXi?
VMware ESXi is a bare-metal hypervisor that runs virtual machines. Ransomware groups target it because one host can hold many servers.
Enterprise softwareWhat is Activiti?
Activiti is an open-source BPMN workflow engine for Java applications. Script tasks in a process definition can run code on the server.
Enterprise softwareWhat is Zimbra?
Zimbra Collaboration is an email and collaboration suite. Its internet-facing servers are frequent targets of exploitation.
Enterprise softwareWhat is FortiGate?
FortiGate is Fortinet's line of firewall and VPN appliances. Exploited edge devices are a common entry point and a place to hide C2.
Odin Research
Get the rules, not just the definition
Every Odin Research report ships with verified indicators and detection rules you can load today.