n8n security: what a self-hosted instance holds, and how to check yours

A self-hosted n8n stores the API keys, database passwords and OAuth tokens of every workflow, and can run code on its server. Its security rests on four things: an owner account created before a stranger finds the instance, a current version, an editor kept off the public internet, and public webhooks and forms treated as untrusted input. Several critical advisories were published from December 2025 to April 2026.

The team behind Keybrum's attacksUpdated 10 min read

In short

  • n8n listens on port 5678 and, by default, on every network interface (N8N_LISTEN_ADDRESS defaults to ::). On a cloud server with an open firewall, the editor is on the internet.
  • The first person to open a fresh instance creates the owner account. An instance deployed and never opened belongs to whoever opens it first.
  • CVE-2026-21858 (CVSS 10.0) let an unauthenticated attacker read files from the server through certain form workflows. It affects versions 1.65.0 to before 1.121.0.
  • Most other critical advisories need a user who can edit workflows. On n8n, that user can usually reach code execution, so every editor account is a server account.
  • Run n8n audit for the built-in report, and check from another network that the editor does not answer on your server's address.
On this page

What a self-hosted n8n holds

n8n is a workflow automation tool that you can run on your own server. A workflow connects services: a form to a spreadsheet, a webhook to a CRM, a model to your inbox. To do that, n8n stores a credential for each service. After a few months, a working instance holds the keys to most of what you run.

What is on the instanceWhy it matters
Credentials of every workflowAPI keys, database passwords and OAuth tokens, encrypted in n8n's database with a key that lives on the same server
WorkflowsYour business logic, the addresses of internal services and, often, secrets pasted into nodes
Execution historyThe data that passed through: customer records, emails, payloads
Code executionThe Code node runs JavaScript or Python. Other nodes read files and call any address the server can reach
Public entry pointsWebhook and form addresses that anyone on the internet can call

So the security question for n8n is short. Who can sign in to the editor, and what can a stranger send to the public entry points? Someone who becomes owner or editor of your instance does not need to break anything else. They read the credentials and use them.

The owner account: the first check to make

n8n's documentation describes the first run: when you set up user management for the first time, you create an owner account, on a signup screen shown when the app is first opened. Basic auth and JWT authentication for the editor were removed in n8n 1.0, so this account is the lock on the door.

The trap is the instance that was deployed and never opened. A Docker Compose file from a tutorial, a test server, a second instance for staging: if nobody completed the signup screen, the next visitor does. That visitor is then the owner, with no vulnerability involved.

n8n's security settings, from its own docs

The "Securing n8n" section of docs.n8n.io lists the measures the project recommends. These are the ones that change what a stranger or a low-privilege user can do.

SettingWhat it doesHow
Security auditReports unused credentials, risky nodes, SQL built from expressions, unprotected webhooks and an outdated instancen8n audit on the command line, or POST /audit as the owner
SSLServes the editor and webhooks over HTTPSA reverse proxy in front of n8n, or n8n's own SSL settings
Two-factor authenticationAdds a second factor to email and password sign-in. Enforcing it for everyone is under Settings, Policies, on Business and Enterprise plansEach user's settings
Block specific nodesRemoves nodes that run commands or touch the disk. The docs say some nodes, like Execute Command, are blocked by defaultNODES_EXCLUDE
SSRF protectionStops workflow nodes from calling private and link-local addresses, such as a cloud metadata serviceN8N_SSRF_PROTECTION_ENABLED=true
Task runnersRuns Code node JavaScript apart from the main n8n process. The hardening guide recommends external mode, a non-root user and a read-only filesystemThe task runner settings
Disable the public APITurns off the REST API and its playground if you do not use themN8N_PUBLIC_API_DISABLED=true, N8N_PUBLIC_API_SWAGGERUI_DISABLED=true
Redact execution dataHides input and output data in saved executionsWorkflow and instance settings
Encryption keyThe key that encrypts stored credentials. n8n generates one if you set none. The docs describe how to rotate itN8N_ENCRYPTION_KEY

One default deserves attention. The deployment variables page gives N8N_PORT a default of 5678 and N8N_LISTEN_ADDRESS a default of ::, which means all interfaces. n8n does not restrict itself to the local machine. Whether the internet can reach the editor depends on your firewall and on how Docker published the port.

Recent n8n advisories, with fixed versions

n8n publishes its security advisories on GitHub, in the n8n-io/n8n repository. The winter of 2025 to 2026 brought a series of critical ones. The table lists those we verified in the GitHub Advisory Database, with the versions that fix them. It is not the full list.

AdvisoryPublishedCVSSWhat it allowsFixed in
CVE-2025-6861322 Dec 20259.9Code execution by an authenticated user through workflow expressions1.120.4, 1.121.1, 1.122.0
CVE-2025-6866826 Dec 20259.9Command execution through the Python Code node, in versions 1.0.0 to before 2.0.02.0.0
CVE-2026-218776 Jan 20269.9Code execution by an authenticated user, through an arbitrary file write1.121.3
CVE-2026-218587 Jan 202610.0File access on the server by an unauthenticated attacker, through certain form-based workflows1.121.0
CVE-2026-2749325 Feb 20269.0Expression evaluation by an unauthenticated visitor through a Form node, in a specific workflow configuration1.123.22, 2.9.3, 2.10.1
CVE-2026-4223129 Apr 202610.0Code execution by a user who can edit workflows, through the XML webhook body parser1.123.32, 2.17.4, 2.18.1
Scores and versions from the GitHub Advisory Database, read on 13 November 2026.

Two things stand out. First, CVE-2026-21858 and CVE-2026-27493 need no account: they go through forms and webhooks that are public by design. The advisory for the first one gives no workaround other than restricting public webhook and form endpoints until you upgrade. Second, most of the others begin with "an authenticated user". On n8n, an account that can edit workflows has repeatedly been a path to running code on the host. Give editor access as you would give SSH access.

The flow has not stopped. The repository published about a hundred advisories between early August and 13 November 2026, most of them rated medium or high. Several published on 13 November 2026 are fixed in 2.47.6, 2.48.3 and 3.2.2. An instance that is six months behind is missing many fixes, so the rule is simple: stay on a supported release line and update when a security release appears.

How to check your own instance from outside

  1. 1

    Find your version

    Run n8n --version on the server, or inside the container. Compare it with the fixed versions above and with the latest release of your line on GitHub.

  2. 2

    See whether the editor is reachable

    From another network, such as your phone's connection, open your server's address on port 5678 and your n8n domain. If the sign-in page loads from anywhere, the editor is public. That is a choice some teams make, and it then depends entirely on passwords, 2FA and the version.

  3. 3

    Check that the owner exists

    The page must ask you to sign in. If it offers to set up an owner account, do it now. The command below reads the same flag the editor reads.

  4. 4

    List your public entry points

    In n8n, list the workflows that start with a Webhook, Form or Chat trigger. Each one has an address anyone can call. For each, check the authentication option of the trigger and what the workflow does with the input.

  5. 5

    Run the audit

    n8n audit prints the report by category. Read the instance section for unprotected webhooks and the nodes section for community and risky nodes.

bash
# On the server
n8n --version
n8n audit

# Docker: which host ports are published?
docker ps --format '{{.Names}}  {{.Ports}}'

# From outside, against YOUR OWN instance: was the owner account ever created?
curl -s https://n8n.your-domain.example/rest/settings \
  | jq '.data.userManagement.showSetupOnFirstLoad'
true means the instance is still waiting for its first owner. This is an internal endpoint of the editor, so its shape can change between versions: the sign-in page is the reference.

A hardening order that fits a small team

  • Update to the latest release of a supported line, and subscribe to the repository's security advisories
  • Create the owner account on every instance, including test and staging ones
  • Put the editor behind a VPN, Tailscale, or a reverse proxy with an IP allow list. Expose only the webhook paths that need to be public
  • Close port 5678 in the cloud firewall, and check that Docker did not publish it on every interface
  • Turn on 2FA for every account, and give edit rights only to people you would give server access to
  • Add authentication to Webhook triggers, and validate what public forms send before it reaches an expression, a query or a Code node
  • Set N8N_SSRF_PROTECTION_ENABLED=true, and keep Execute Command blocked unless you need it
  • Set your own N8N_ENCRYPTION_KEY, back it up apart from the database, and rotate the stored credentials after any incident
  • Use credentials with the narrowest scope each workflow needs

The last line is the one that limits the damage when everything else fails. A workflow that reads one spreadsheet does not need a token for your whole workspace. The same reasoning applies to AI agents built in n8n: text that arrives through a webhook or an email can carry instructions for the model, see prompt injection. If keys did leak, follow what to do about a leaked API key.

What Keybrum tests on n8n, and what it does not

Keybrum is the automated pentest we build for apps made with AI tools. For n8n it has one check, and it is the owner account. On the server proven to serve your app, it asks port 5678 for n8n's settings with no credentials. It asks the same question on the app's own address, for the case where the app you verified is the n8n itself. A finding is reported only when n8n answers that its owner account was never set up. That finding is rated critical, since the next visitor becomes the owner. Nothing is created and no setup form is submitted.

What it does not do: it does not match your n8n version against the advisories above, it does not sign in, and it does not call your workflows' webhooks or forms. An n8n with an owner and an old version passes this check and is still at risk. For that, use n8n --version and n8n audit. Hosted Keybrum never attacks private networks, so an instance reachable only inside your network is out of its sight, which is where it should be.

The same pass asks the server about other tools that people run next to an app: Ollama, Open WebUI, Flowise, Langflow, Dify, vector databases and Jupyter, each with one read-only question. It also looks for databases and admin ports open to the internet. A one-time report costs €49 for one app. Plans start at €29 a month excluding VAT. Keybrum only attacks apps whose owner proved ownership. More on the outside view in external penetration testing.

Questions

Is n8n safe to self-host?

Yes, if you treat it as a server that holds all your keys. Create the owner account at once, keep the version current, keep the editor off the public internet and give edit rights sparingly. Most serious incidents described in n8n's advisories need either an old version or an account on the instance.

What is CVE-2026-21858 in n8n?

It is a vulnerability rated 10.0 that let an unauthenticated attacker access files on the server through certain form-based workflows. It affects n8n from 1.65.0 to before 1.121.0 and is fixed in 1.121.0. The advisory lists no official workaround other than restricting public webhook and form endpoints.

Which n8n version should I run?

The latest release of a supported line. On 13 November 2026, the newest advisories named 2.47.6, 2.48.3 and 3.2.2 as fixed versions. Check the releases and the security advisories of the n8n-io/n8n repository, because they change often.

Should the n8n editor be exposed to the internet?

It is safer not to. Put the editor behind a VPN or an allow list, and expose only the webhook and form paths that outside services must reach. If the editor has to be public, enforce 2FA and update on every security release.

Are n8n webhooks public?

A webhook or form address answers anyone who knows it, unless you set an authentication option on the trigger. Treat what arrives as untrusted input. Two of the critical advisories of early 2026 went through public forms.

Where does n8n store credentials?

In its database, encrypted with a key. The docs say n8n generates a random key if you do not provide N8N_ENCRYPTION_KEY. Anyone who gets both the database and the key, or an owner session, can use every stored credential.

Sources

  1. 1.Securing n8n, n8n Docs
  2. 2.Security advisories for n8n-io/n8n, GitHub
  3. 3.GHSA-v4pr-fm98-w9pg: Unauthenticated File Access via Improper Webhook Request Handling (CVE-2026-21858), GitHub Advisory Database
  4. 4.GHSA-v98v-ff95-f3cp: Remote Code Execution via Expression Injection (CVE-2025-68613), GitHub Advisory Database
  5. 5.GHSA-75g8-rv7v-32f7: Unauthenticated Expression Evaluation via Form Node (CVE-2026-27493), GitHub Advisory Database
  6. 6.Set up user management on self-hosted n8n, n8n Docs
  7. 7.Deployment environment variables, n8n Docs

Your app is public. So are its mistakes.

Check what any attacker can already see in it, free, in ten seconds. The full attack, with proof and fixes: €49 once, or €29 a month on a plan.

or continue with Google or GitHub