Take a twelve-person company. In late 2025, someone installed n8n on a small rented server using Docker or Coolify. It has run without trouble ever since. A form on the website feeds the CRM, a webhook receives orders, and several workflows read the Qonto business bank account (a French neobank) and the Google Workspace calendars. Nobody has changed the version since the install, because everything works.
On January 7, 2026, n8n published a critical security advisory rated 10 out of 10. If the installed version was in the affected range, a public form could be enough for an attacker to read files on the server without any credentials. A fix was available, but someone still had to install it.
This article describes how to secure self-hosted n8n with a short routine, ordered by priority, for a company without an IT team. It covers watching the advisories, updating with a backup and a rollback plan, reducing what is exposed to the internet, and protecting credentials and the encryption key.
Ni8mare (CVE-2026-21858): what happened
The official n8n advisory, published January 7, 2026, covers versions 1.65.0 up to, but not including, 1.121.0, with a CVSS score of 10.0. Some form-based workflows allowed an unauthenticated attacker to access files on the server and, depending on the configuration, go further. The fix shipped in version 1.121.0.
The advisory states that there is no official workaround. Until an instance could be updated, n8n suggested restricting or disabling publicly accessible webhooks and forms.
The team at Cyera Research Labs found the flaw and named it Ni8mare. They explain that every webhook-style trigger (forms, chat, WhatsApp) goes through the same request-parsing function. The Form node did not check the content type it received. By forging that content type, an attacker could make the workflow read any file on the server and then take full control of the instance.
Censys reported 26,512 exposed hosts running a version older than 1.121.0 at the time of its advisory. Censys rated self-hosted deployments, Docker installs included, as the highest risk.
Three conditions came together: an old version, a public form, and nobody reading the advisories. The routine below deals with each one.
Know your version and follow n8n security advisories
Start by finding out which version is actually running. In the editor, the help menu shows it under "About n8n". A Docker Compose file that uses the latest tag doesn't answer the question, because the version depends on the day the image was pulled.
According to the Docker installation documentation, n8n ships a new minor version almost every week. The stable release is meant for production, and beta can be unstable. As of November 15, 2026, the documentation lists 2.47.7 as the stable version, a number that changes quickly. An instance still on 1.x is therefore a full major version behind.
Security advisories are published on the advisories page of the n8n repository on GitHub, and they come often. In mid-November 2026, the first page of the list shows ten advisories published on a single day, October 14, 2026, three of them rated "High".
I recommend naming one person to check that page every week, and following the repository's releases on GitHub (Watch button, Releases option). For each new advisory, three questions are enough:
- How severe is it? "Critical" and "High" come first.
- Is my version in the affected range?
- Does it affect a node or feature I use, or something exposed to the internet?
If the answer to all three is yes, update within 48 hours or temporarily switch off whatever is exposed.
Update n8n without breaking production
An update takes five steps.
1. Back up the database and the encryption key. By default, n8n stores workflows, credentials and executions in a SQLite database inside the .n8n folder, which is mounted as a Docker volume. If you use PostgreSQL, back up that database. In both setups, the .n8n folder also holds the encryption key, according to the Docker documentation.
This key (N8N_ENCRYPTION_KEY) encrypts the credentials. If you never set one, n8n generates one on first launch. Without the key, a backup won't give you your credentials back. Copy it into the company password manager, somewhere other than the server.
2. Read the release notes. Before a major version, read the breaking changes page. The page for n8n 3.0 lists removed nodes and key rotation turned on by default. It also states that n8n 2.x writes a warning to the logs at startup for each change that affects your instance.
3. Pin the version. In the Compose file, replace latest with a specific number: n8nio/n8n:<stable version>, using the stable version listed in the documentation on the day you update. Updating then means changing that number and running docker compose pull, docker compose down and docker compose up -d, the commands given in the documentation. The instance is stopped between down and up -d, so webhooks and forms won't respond during that short interruption: schedule it at a quiet time. Coolify works the same way: the image and its tag are set in the n8n service configuration (see the Hetzner, Coolify and n8n stack).
4. Test. Trigger one workflow per trigger type (form, webhook, schedule), check that a credential still decrypts, then watch for errors over the next 24 hours, ideally with an error workflow (see n8n error handling in production). For a major version, try it on a copy of the instance first.
5. Plan the rollback. Going back to the previous tag doesn't always work, because a new version can change the data. The key rotation documentation gives an example: once rotation is enabled, earlier versions can no longer read the credentials, and the only way back is to restore a database backup.
Reduce what is exposed to the internet
The fewer entry points your instance exposes, the less an advisory like Ni8mare applies to you.
Inventory the public entry points. List the active workflows that start with a webhook, a form or a chat, and deactivate the ones nobody uses anymore. A forgotten test form is still an open door.
Separate the editor from the webhooks. Webhooks need to be reachable from the internet. The editor doesn't. I recommend putting the editor behind a VPN or an IP allowlist at the reverse proxy, and leaving only the webhook and form paths public. These paths appear in the URLs shown by your nodes, so check them before writing the rule.
Verify where calls come from. Since n8n 2.21, released May 12, 2026, fourteen trigger nodes, including Calendly and GitLab, verify the signature of incoming webhooks and reject forged requests (n8n 2.21 release notes). For your generic webhooks, set up authentication whenever the caller supports it.
Accounts and two-factor authentication. Remove the accounts of people who have left. The security page of the documentation points to two-factor authentication, to security policies that can enforce it, and to SSO. Check what your edition allows.
Turn off what you don't use. The same page explains how to disable the public API, block specific nodes, enable SSRF protection and run a security audit. The What you can do page gives Execute Command and SSH as examples of nodes you can disable, and points to the risks of community nodes.
If you have opened an MCP server on the instance, add it to the inventory as one more entry point (see the n8n MCP server with controlled access).
Credentials and secrets: what a compromised instance exposes
An n8n instance collects the company's access keys in one place: API keys, OAuth tokens, passwords. They are encrypted in the database, but the encryption key lives on the same server, so anyone who takes over the machine can in principle read both. For Ni8mare, Censys described a full compromise of the host, including the ability to steal secrets and move laterally to other systems.
Depending on the permissions granted to each credential, that can mean:
- the Qonto key: transactions and receipts from the bank account (see Qonto and n8n bank reconciliation);
- the Pennylane key (a French accounting platform): the books, customers and suppliers;
- the Google Workspace connection: emails, Drive files, calendars;
- the CRM: the full customer base, often with write access.
Four measures limit the damage:
- Minimal permissions. When the tool allows it, create a dedicated key for n8n, limited to what the workflow does. A bank reconciliation only needs read access.
- An inventory. A table of credentials: service, permissions, workflows that use it, creation date. Delete the ones nobody uses.
- Purged executions. Execution data can contain secrets. One of the October 14, 2026 advisories concerned credentials visible in the error data of several nodes. For GDPR reasons, the What you can do page recommends pruning execution data automatically every few days, using the
EXECUTIONS_DATA_MAX_AGEvariable. - Key rotation. n8n separates the instance's main key from a data key that can be renewed. The feature is enabled through an environment variable in 2.x and will be on by default in 3.0 (documentation). Back up the database before turning it on.
If you suspect a compromise (an unknown account, a workflow nobody created, executions nobody can explain), updating is no longer enough. Revoke and regenerate every key in the services themselves, then rebuild the instance from a clean backup. At that point, I recommend getting help.
Secure self-hosted n8n: the monthly routine
| Task | Frequency | Who |
|---|---|---|
| Read new n8n security advisories | Every week | Internal owner |
| Update to the latest stable version, after a backup | Every month, within 48 h for a critical advisory that affects you | Owner or contractor |
| Check that a backup restores, key included | Every month | Owner or contractor |
| Review active public webhooks and forms | Every month | Internal owner |
| Review user accounts and two-factor authentication | Every month | Manager or owner |
| Update the server operating system | Every month | Owner or contractor |
| Review the credentials inventory and permissions | Every quarter | Internal owner |
Reading advisories and keeping inventories doesn't require an IT background. Updates and restores require someone comfortable with Docker.
Self-hosted, n8n Cloud, or outside help
The n8n documentation is explicit. It reserves self-hosting for expert users, warns that mistakes can lead to data loss, security issues and downtime, and recommends n8n Cloud for anyone not used to managing servers.
I advise staying self-hosted if a named person runs the routine, if a restore has already been tested, and if you have a reason to keep control: data location, execution volume, or access to internal systems. Otherwise, n8n Cloud is a better fit, especially with only a few workflows. For recurring costs more broadly, see the article on the monthly cost of an AI agent in production.
Outside help makes sense in four cases: an instance still on 1.x with many workflows, a major version upgrade, a suspected compromise, or an architecture that needs rethinking. To sort out what you can handle, see what you can do yourself with n8n. At Kirako, we provide audits and consulting and n8n automation projects.
An up-to-date instance with few public entry points, credentials with limited permissions and a tested backup makes an advisory like Ni8mare far less serious. The routine takes little time each month, as long as it doesn't get forgotten the way the instance version did.
Sources
Accessed November 16, 2026:
- n8n: advisory GHSA-v4pr-fm98-w9pg (CVE-2026-21858), list of security advisories, installing and updating with Docker, securing a self-hosted instance, What you can do, rotating encryption keys, deployment variables, n8n 3.0 breaking changes, release notes
- Cyera Research Labs: Ni8mare, Unauthenticated Remote Code Execution in n8n (January 7, 2026)
- Censys: CVE-2026-21858 advisory (January 7, 2026)
Also available: Read in French