Agentshield

n8n Security: Vulnerabilities, AI Agent Risks, Self-Hosted Hardening and Enterprise Controls

One n8n remote code execution flaw is on CISA's Known Exploited Vulnerabilities catalog. Another scored a straight 10.0. Both were reachable through the workflow engine itself.

OWASP LLM Top 10 Immutable audit trail Never trains on your data

Direct answer

n8n security breaks into three layers that fail independently. The first is the platform: three critical remote code execution vulnerabilities were published against n8n between December 2025 and February 2026, one of them scored CVSS 10.0 and reachable without authentication, and one of them added to CISA's Known Exploited Vulnerabilities catalog on March 11, 2026 after evidence of active exploitation. Every one is patched, so a current version closes the whole set. The second layer is the community node ecosystem, and n8n's own documentation states the risk plainly: "Community nodes have full access to the machine that n8n runs on, and can do anything, including malicious actions." In January 2026 that stopped being theoretical when Endor Labs found a set of malicious npm packages posing as integrations and harvesting decrypted OAuth tokens at workflow runtime. The third layer is the one no patch reaches: an n8n AI Agent node holds real credentials for your real systems, and a workflow that reads untrusted input and then calls tools is an agent with production access. This page covers all three, cites NVD, CISA and n8n's own docs rather than summaries, and includes a table of what a policy layer does not fix, because several of the important things it does not.

Try it live

Watch Agentshield block an attack in real time.

Pick a scenario and drive the inspection lane yourself. No signup needed.

Threat Console
12,408 injections blocked this week

Run a request

Inspection lane

INSPECTING
untrusted input

Policy trace

High-risk action held for approval

Audit trail

The risk

n8n arrived through the ops team or a growth engineer, not through procurement. It now holds live credentials for your CRM, your billing provider, your data warehouse and your email, because that is what makes it useful. Somewhere in there an AI Agent node reads inbound tickets or scraped pages and decides which tool to call next. Nobody can currently tell you which version the instance runs, which community nodes are installed, which of the stored credentials are still referenced by an active workflow, or what an agent step actually did last Tuesday at 3am.

How Agentshield handles it

Separate what patching fixes, what n8n configuration fixes, and what only your side can enforce. Patching closes the published CVEs, and the version floor is a genuine control rather than a formality: everything below 1.123.17 or 2.5.2 carries at least one critical remote code execution flaw and one of them is on the CISA exploited list. Configuration covers most of the rest of the instance, and n8n ships more of it than teams use, including a built-in audit command, node blocking, SSRF protection, encryption key rotation and execution data redaction. What neither reaches is blast radius. When a workflow step calls Salesforce or your internal API, it presents a long-lived credential that n8n decrypted into process memory, scoped to whatever a human once granted. Routing those calls through a control point gives each workflow its own scoped identity, a default-deny egress path, an approval gate on irreversible actions, and an append-only record held off the n8n host. That layer keeps working on the day the fourth expression-engine escape is published.

The controls

The controls that secure the n8n workflows and AI Agent nodes your team runs against your credentials, your SaaS accounts and your internal systems.

n8n security vulnerabilities: the 2026 CVE record

Three published CVEs matter for a security review, and two of them share a root cause worth understanding: n8n evaluates expressions inside workflow parameters, and the isolation around that evaluation kept turning out to be thinner than intended. The third needed no login at all.

CVEWhat it isSeverityFixed in
CVE-2026-21858, named Ni8mare by its findersNVD: versions "starting with 1.65.0 and below 1.121.0 enable an attacker to access files on the underlying server through execution of certain form-based workflows. A vulnerable workflow could grant access to an unauthenticated remote attacker, resulting in exposure of sensitive information stored on the system and may enable further compromise depending on deployment configuration and workflow usage." No credentials requiredCVSS 3.1 base 10.0 critical (AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N). CWE-20 improper input validation. Published January 7, 2026n8n 1.121.0
CVE-2025-68613Remote code execution in the workflow expression evaluation system. An authenticated user able to create or modify a workflow could abuse insufficient isolation in expression evaluation contexts to execute arbitrary code with the privileges of the n8n process. Affects 0.211.0 up to 1.120.4, plus 1.121.0Scored 8.8 high by NIST and 9.9 critical by the CNA, GitHub. The gap is a scope disagreement: the CNA judged that the exploit crosses a security boundary, NIST did not. CWE-913. Published December 19, 2025. ‼️ Added to the CISA Known Exploited Vulnerabilities catalog on March 11, 2026n8n 1.120.4, 1.121.1 or 1.122.0
CVE-2026-25049NVD: "Prior to versions 1.123.17 and 2.5.2, an authenticated user with permission to create or modify workflows could abuse crafted expressions in workflow parameters to trigger unintended system command execution on the host running n8n." The same class as the one above, found again after the first fixCVSS 4.0 base 9.4 critical, CVSS 3.1 base 9.9 critical. CWE-913. Published February 4, 2026n8n 1.123.17 or 2.5.2

The CISA listing on CVE-2025-68613 is the detail to carry into a risk conversation, because it changes the argument. CISA adds an entry only on evidence of active exploitation in the wild, and it recorded the vulnerability under the name "n8n Improper Control of Dynamically-Managed Code Resources Vulnerability" with a remediation deadline of March 25, 2026 for federal agencies. Its required action is worth quoting in full because it is the standard the rest of the market ends up measured against: "Apply mitigations per vendor instructions, follow applicable BOD 22-01 guidance for cloud services, or discontinue use of the product if mitigations are unavailable." If you are self-hosting n8n and cannot say which version you run, that sentence is your answer to whether this is urgent.

Read the authentication requirement carefully rather than as reassurance. Two of the three flaws need an authenticated user who can edit workflows, and teams read that as "so only trusted staff." In practice, the population that can edit an n8n workflow is usually much larger than the population you would consciously grant shell access to on that host, and it often includes contractors and a shared login. Editing a workflow and running commands on the server were supposed to be different privileges. In these versions they were the same one.

The remediation is genuinely simple, which is the good news here. Run 1.123.17 or later on the 1.x line, or 2.5.2 or later on the 2.x line, and all three are closed. Verify by querying the instance rather than by asking whoever set it up.

n8n community nodes: full machine access, no sandbox

This is the part of n8n security that patching does not touch, and n8n deserves credit for documenting it without softening. Its community nodes risk page states: "Community nodes have full access to the machine that n8n runs on, and can do anything, including malicious actions." It adds that "Any community node that you use has access to data in your workflows." Those two sentences describe an npm package running with your automation platform's full privileges and your decrypted credentials in reach.

In January 2026 that model was attacked directly. Endor Labs documented a campaign of malicious npm packages published as n8n community nodes, dressed up as ordinary integrations. Their description of why it worked is the clearest statement of the underlying design anyone has published: "Community nodes run with the same level of access as n8n itself. They can read environment variables, access the file system, make outbound network requests, and, most critically, receive decrypted API keys and OAuth tokens during workflow execution." They also note the structural point: "There is no sandboxing or isolation between node code and the n8n runtime."

PackageWeekly downloads reportedWhat it did
n8n-nodes-hfgjf-irtuinvcm-lasdqewriit3,498The primary sample, published across 14 versions from 0.0.1 to 0.0.28 and identified January 9, 2026. Presented a convincing Google Ads style credential form, then exfiltrated what the user entered
n8n-nodes-gg-udhasudsh-hgjkhg-official3,150Same campaign. Note the word "official" in the package name, which is the entire social engineering budget
n8n-nodes-ggdv-hdfvcnnje-uyrokvbkl1,557Same campaign, same author cluster
n8n-nodes-vbmkajdsa-uehfitvv-ueqjhhhksdlkkmz450Same campaign
n8n-nodes-performance-metrics96The plausible-sounding one, which is why it belongs in this table

What left the building was not just a password. Endor Labs reports the stolen material included developer tokens, client IDs and client secrets, refresh tokens, login customer IDs and user-entered license keys, sent to a command and control endpoint hosted on a free application platform under a name designed to look like license validation. Refresh tokens are the ones that matter for incident response, because they survive a password reset and keep working until someone explicitly revokes the grant.

Two operational conclusions follow, and neither is "review the source code." Reviewing helps, but the packages in this campaign shipped minified JavaScript and a maintainer can push a clean version today and a hostile one next Tuesday, at which point your review is a historical artifact. The conclusions that hold up:

  • Treat the installed node list as an inventory item with an owner. n8n lets self-hosted instances disable community nodes entirely, and lets you block specific nodes by name. If your workflows do not need community nodes, turning them off removes this section from your threat model completely. If they do, the list should be short, named and pinned to exact versions.
  • Assume the credential is reachable and reduce what it unlocks. A node that receives a decrypted OAuth token cannot be stopped from using it. What can be changed is what that token is scoped to and how long it lives. This is the same argument as least privilege for AI agents, applied to a workflow engine.

n8n does maintain a set of verified community nodes, which it states have to meet data and system security requirements for approval. That is a real improvement over an open registry, and it is the right default for teams that need the ecosystem. It is not a substitute for pinning versions, because verification is a point-in-time judgment about a package that keeps changing.

n8n AI Agent security: what changes when a workflow can choose its own tools

Everything above is classic application security. This section is the part that is specific to 2026, and it is the reason a lot of n8n instances quietly became the most privileged thing in the company.

A traditional n8n workflow is deterministic. A trigger fires, steps run in the order you drew them, and the set of possible actions is fixed at design time. You can reason about it. An AI Agent node breaks that property on purpose: it is given a set of tools and it decides at runtime which to call, with what arguments, and how many times. That is the feature. It is also the thing that makes a security review of the diagram insufficient, because the diagram no longer enumerates the behavior.

Now add the input. Agent workflows are usually built precisely because the input is messy and unstructured: inbound support email, scraped pages, form submissions, Slack messages, documents, RSS. Every one of those is attacker-influenced text arriving at a component that treats text as instructions. That is indirect prompt injection, and it is a different problem from a user typing a jailbreak into a chat box, a distinction we go through on prompt injection vs jailbreak.

Put the two together and the failure mode is concrete rather than abstract. A support ticket contains text addressed to the agent instead of to you. The agent has an HTTP Request tool, a Gmail tool and a Postgres tool, because that is what made the automation useful. It follows the instruction in the ticket. Nothing in that sequence is a bug in n8n, nobody exploited a CVE, and the workflow did exactly what it was configured to do.

n8n AI Agent design choiceWhy it is thereWhat it exposes
Tools are bound to the agent, not to the requestThe agent needs to pick a tool at runtime, so it must hold all of themEvery input reaching the agent has the union of all its tools available, including the destructive ones it will use once a month
Credentials are stored once and decrypted at executionOtherwise nothing could run unattendedAny code in the process at execution time is inside the credential boundary, which is exactly what the community node campaign exploited
Agent steps loop until they decide they are doneMulti-step reasoning is the point of an agentOne hostile input can produce many tool calls. Rate and volume limits belong at the tool, not at the trigger
Untrusted content is the normal inputTickets, emails and scraped pages are why the workflow existsThe injection surface is not an edge case in these workflows, it is the primary data path
MCP servers can extend the tool setReuse of existing integrationsTool descriptions become model-readable instructions from a third party. See MCP server security

The fix is not a better prompt, and anyone selling you one is overselling. Instructions to ignore instructions are not a boundary, because the model has no reliable way to tell your text from the attacker's text. The controls that survive are containment controls: give the agent its own identity rather than a shared service account, scope each tool credential to the narrowest thing that still works, put a human in front of anything irreversible, and log the calls somewhere the n8n host cannot rewrite. We cover the containment argument in more depth on AI agent guardrails, the identity half on AI agent identity, and the same problem inside a Microsoft tenant on Copilot Studio security.

One n8n-specific control is worth naming because it is free and underused. The built-in audit does part of this inventory for you.

n8n Cloud vs self-hosted security: an honest split

Teams ask which is more secure and expect a winner. There is not one, but the risks are genuinely different, and for a US buyer one row below matters more than most comparisons mention.

Dimensionn8n CloudSelf-hosted
Patching the CVEs aboven8n operates the version. This is the strongest single argument for Cloud, since the CISA-listed flaw was a patching problemYours. This is where unpatched instances live, and an n8n a growth team stood up in Docker eighteen months ago is the realistic worst case
Community nodesManaged through the admin panelCan be disabled entirely, or restricted to a named allowlist. More control, and more chance nobody used it
Data residencyn8n states that "The physical hardware powering n8n, and the data stored by the platform, is currently hosted in the European Union." For a US company that is a fact to check against your own commitments, not automatically a problem, but it does surprise peopleWherever you put it. This is the main reason regulated US teams self-host
Encryption at restn8n states it "encrypts customer data at rest in your instance's mounted volume" using "Azure Storage server-side encryption (using AES256 and a FIPS-140-2 compliant implementation)"Whatever your volume does. Frequently nothing, on a VPS someone provisioned quickly
Audit evidencen8n states it "aligns its security program to SOC 2" and publishes a SOC 3 report for download, with the SOC 2 report available to enterprise customersYou are the auditee. Your controls, your evidence, and the workflow execution log is not an audit trail

The honest summary: Cloud removes the risk that has actually been exploited in the wild, which is running an old version. Self-hosting gives you residency and node control, and hands you the patching duty that the CVE section shows is not optional. Pick on which failure your organization is more likely to make, not on which sounds more secure.

Two things are identical either way, and they are the ones this page keeps returning to. The credentials n8n holds are equally powerful in both models, and an AI Agent node reading untrusted input behaves the same on both. Neither deployment choice touches those. If you are documenting this for an auditor or a customer security questionnaire, the framing that holds up is on AI compliance.

n8n self-hosted security hardening: the checklist

Ordered by risk removed per hour spent. The first five are n8n configuration and cost close to nothing.

  1. Set a version floor of 1.123.17 or 2.5.2 and verify it by query. This closes all three critical remote code execution flaws, including the one CISA lists as actively exploited. Verify against the running instance, not against the deployment doc.
  2. Run the built-in audit and act on it. n8n ships an n8n audit command that reports across five categories: credentials, database, file system, nodes and instance. It flags credentials not used in any workflow or not used in a recently active one, expressions used in SQL node query fields, nodes that touch the file system, risky official nodes alongside community and custom nodes, and instance-level problems including unprotected webhooks, missing security settings and an outdated version. Most teams have never run it. The unused-credential list alone is usually the fastest cleanup available.
  3. Decide the community node policy explicitly. Disable them outright if workflows do not need them. If they do, allowlist by name, pin exact versions, prefer n8n's verified nodes, and give the list an owner. n8n also supports blocking specific nodes, which is the right home for the ones that read the file system or execute code.
  4. Turn on the settings n8n already ships. Its own guidance is to "Conduct a security audit to identify security risks," "Set up SSL to enforce secure connections," "Set up Single Sign-On for user account management," "Use two-factor authentication (2FA) for your users," and "Enable encryption key rotation to periodically replace the key that encrypts credentials." Add SSRF protection, disable the public API if nothing uses it, and require verified emails for account registration. SSO, SAML and LDAP sit on the Enterprise plan; RBAC is on all paid plans.
  5. Redact execution data. n8n can "Redact execution data to hide input and output data from workflow executions." Execution history is a full copy of everything that moved through the workflow, including whatever the CRM returned, and it sits in a database that more people can read than can call the CRM. This is a common quiet source of exposure, discussed further on AI data leak prevention.
  6. Protect every webhook. An n8n webhook is an unauthenticated internet-facing entry point into your automation unless you gave it authentication. The audit flags unprotected ones. Ni8mare was reachable through form-based workflows, which is the same category of exposure.
  7. Scope the credentials down. The Salesforce credential in n8n usually has whatever the person who created it had. Issue a dedicated integration user per workflow with the narrowest role that works, and prefer short-lived tokens where the provider supports them. This is the control that decides how bad a community node compromise gets. See AI agent access control.
  8. Give agent traffic its own identity. When an n8n step calls your internal API with a shared service token, the request is indistinguishable from every other automation in every log you own. Separating identity per workflow is what makes the rest of this investigable at all.
  9. Gate irreversible actions on a human. Deletions, refunds, outbound email to customers, production writes, anything that cannot be undone by rerunning the workflow. n8n has a wait-for-approval pattern, and where that pattern breaks down is on human in the loop AI agents.
  10. Log tool calls off the n8n host. Execution history lives in the same database as the thing you are investigating and is editable by anyone with instance admin. If you need to answer what a workflow touched during an incident window, that record has to be somewhere else. See agent audit trail.

Items one through six are n8n configuration and belong to whoever operates the instance. Items seven through ten are infrastructure, they apply identically to every agent platform in your estate, and they are the reason a review scoped to "is n8n secure" tends to commission the wrong project. The same split showed up in a coding agent on Cursor AI security, in an agent framework on OpenClaw security, in a low-code enterprise builder on Copilot Studio security, and at infrastructure scale in the Hugging Face security incident.

What a runtime control point does and does not fix for n8n

We sell a policy gateway, so read this skeptically. It is written to be accurate rather than flattering, and half the rows say no or partly.

n8n riskDoes a policy gateway help?What actually fixes it
An unauthenticated RCE in the n8n platform, like Ni8mareNo. That is code running inside the n8n process, behind anything we sit in front ofPatching. 1.123.17 or 2.5.2 and later, verified by query. Nothing on your side substitutes for the vendor fix
A malicious community node reading environment variables and the file systemNo. Once hostile code is in the runtime it can read what the runtime can readDisabling or allowlisting community nodes, pinning versions, and reducing what the credentials in that environment unlock
A malicious community node using a stolen token against a third-party SaaS APIPartly. Calls that route through the control point are scoped and logged. A node that opens its own socket to a vendor API is outside itEgress policy on the n8n host plus narrowly scoped, short-lived credentials at the provider. Both, not either
Prompt injection reaching an AI Agent node through a ticket, an email or a scraped pagePartly. We inspect untrusted content before an agent acts on it, but no filter is complete and we will not claim otherwiseContainment rather than detection. Assume the injection lands and constrain what the agent can then do. See prompt injection protection
An agent step calling a production system with a broad shared credentialYes. Calls carry a scope attached to the workflow making them, so a lifted token is not a usable onePer-workflow identity with short-lived scoped credentials, enforced where the call is made. See tool permissions
No trustworthy record of what a workflow touched during an incidentYes. An append-only log of requested, allowed and denied calls, held off the n8n hostAn audit trail the instance cannot edit, which is the only artifact that survives compromise of that instance

Two flat no, two partial, two yes. If you are running a vendor evaluation, ask every vendor in this market for the same table and treat an all-green answer as a reason to look harder rather than a reason to shortlist. Our survey of who actually does what is in AI agent security companies.

The honest summary of n8n security is that n8n has been forthright about the risks it hands you, ships more hardening than most teams switch on, and had a rough two months of expression-engine disclosures that it patched. None of that is the hard part. The hard part is that n8n is where your credentials live, and adding an AI Agent node turned a deterministic pipeline into something that decides at runtime which of those credentials to use. That change is not visible in a workflow diagram and it is not covered by a patch. It is the same shape as the problem on LangChain security and multi-agent security: constrain what an agent can reach, and keep the record somewhere it cannot rewrite.

FAQ

Common questions about n8n security.

Is n8n secure?

n8n is as secure as the version you run and the credentials you give it. Three critical remote code execution vulnerabilities were published between December 2025 and February 2026, all patched by 1.123.17 and 2.5.2, and one is on CISA's actively exploited catalog. Run a current version, disable or allowlist community nodes, and scope the stored credentials narrowly.

What are the n8n security issues?

Four, in order of how often they cause real damage. Running an unpatched version, since one flaw is CISA-listed as exploited in the wild. Community nodes, which n8n states have full machine access and receive decrypted credentials. Over-broad stored credentials for your SaaS accounts. And AI Agent nodes acting on untrusted input such as inbound tickets or scraped pages.

Is n8n safe to use in business?

Yes, for most teams, with controls. Run 1.123.17 or 2.5.2 or later, run the built-in n8n audit command, decide a community node policy explicitly, enable SSO and 2FA, and redact execution data. The residual risk is not the platform, it is that n8n holds live credentials for your business systems and an agent node can choose which to use.

Is n8n self hosted secure?

Self-hosting gives you the most control and the most responsibility. You choose the data location and can disable community nodes entirely, but you also own patching, and unpatched self-hosted instances are where the CISA-listed vulnerability is actually exploited. If nobody is accountable for upgrading it, n8n Cloud removes the risk that has been exploited in practice.

Is n8n Cloud secure?

n8n Cloud removes the patching burden, which addresses the most exploited risk. n8n states it encrypts customer data at rest using Azure Storage server-side encryption with AES256 and a FIPS-140-2 compliant implementation, and that it aligns its security program to SOC 2. Note that n8n states its platform hardware and data are currently hosted in the European Union.

Are n8n community nodes safe?

Treat them as untrusted code with full privileges. n8n documents that "Community nodes have full access to the machine that n8n runs on, and can do anything, including malicious actions" and that any community node has access to your workflow data. In January 2026 Endor Labs found malicious packages posing as integrations and harvesting decrypted OAuth tokens at runtime.

What is CVE-2026-21858?

A critical n8n vulnerability scored CVSS 10.0, published January 7, 2026, affecting versions from 1.65.0 up to 1.121.0. NVD describes it as enabling an attacker to access files on the underlying server through certain form-based workflows, reachable by an unauthenticated remote attacker. Its finders named it Ni8mare. Upgrading to 1.121.0 or later fixes it.

What version of n8n is safe?

Run 1.123.17 or later on the 1.x line, or 2.5.2 or later on the 2.x line. That floor closes CVE-2026-21858, CVE-2025-68613 and CVE-2026-25049, which together cover an unauthenticated CVSS 10.0 file access flaw and two critical expression-engine remote code execution flaws. Verify the running version rather than the documented one.

Is n8n a security risk?

n8n concentrates risk rather than creating it. It holds working credentials for your CRM, billing, warehouse and email in one place so it can automate them, which is the point. That makes it a high-value target, and it means the questions that matter are version currency, who can edit workflows, what each credential can reach, and what an AI Agent node is allowed to do.

Is n8n MCP safe?

MCP is as safe as the servers you connect, and connecting one extends what an AI Agent node can do. Tool descriptions are read by the model as instructions, so a hostile server can influence agent behavior without exploiting anything. Allowlist servers centrally, pin tool definitions, and log every call rather than reviewing servers once at install time.

Does n8n have SOC 2?

n8n states that it "aligns its security program to SOC 2" and publishes a SOC 3 report for download, with the SOC 2 report available to enterprise customers through its trust center. Request the report, read the exceptions, and map it against the controls your own auditor tests. An attestation covers n8n's operations, not your workflows or your credential hygiene.

Does Agentshield secure n8n?

Partly, and the split matters. We do not patch the n8n platform, so an RCE like Ni8mare is not ours to stop, and we cannot stop hostile code already inside the runtime from reading that environment. What we cover is reach: scoping tool and network calls to the workflow making them, holding irreversible actions for a human, and keeping an append-only record off the n8n host.

Secure your n8n security.