n8n webhook node can run JavaScript as an authenticated user

HighSE Fix-First Score 43/100CVE-2026-54301SE-AIV-01833Script injection in the browserAI softwareMade public 17 Jun 2026

Download as PDF

What this means

An attacker with permission to edit workflows in n8n can set up a webhook that runs JavaScript code in the browser of any authenticated user who visits it. This code runs with full access to that user's session, which means the attacker could read data, change settings, or take actions as that user.

SecurityElites Manager Brief: the decision in one minute

A workflow editor in n8n can trick other users into running malicious JavaScript by crafting a webhook response. This puts every authenticated user at risk of session hijacking and data theft. You need to upgrade n8n immediately.

SecurityElites Fix-First Score43 of 100
Our own ranking of what to fix first. Real attacks count most, then the chance of attack, then severity.
SecurityElites fix windowWithin 30 days
High severity. This is our suggestion from common practice; your own policy comes first.
Who should own the fixPlatform or infrastructure team that manages n8n deployment.
Likely effortAbout 15 to 30 minutes: a version bump and a restart of n8n. It may take longer if you run n8n across multiple servers or in a container orchestration system.

Questions to ask your team or supplier

  • Which users currently have permission to create and edit workflows in our n8n instance, and do we fully trust all of them?
  • Do we have any audit logs or activity history that could show us whether anyone created or modified a Respond to Webhook node in the time between when we started running this version and now?

Message you can forward to the owning team

Security notice: n8n webhook node can run JavaScript as an authenticated user (CVE-2026-54301)

Severity: High
SecurityElites Fix-First Score: 43 of 100
SecurityElites fix window: Within 30 days
Action: upgrade to n8n 2.26.2 or later.
What we need from you: confirm whether we run this software, who owns it, and the date it will be fixed.
Full guide: https://securityelites.com/ai-vulnerabilities/cve-2026-54301-n8n-webhook-node-can-run-javascript-as-an-authenticated/
Source: SecurityElites AI Vulnerabilities Database, record SE-AIV-01833

What is at stake in your AI setup

  • Session cookies and authentication tokens: an attacker gains full access to any authenticated user's n8n account and all data that user can read.
  • Workflow definitions and configurations: the attacker can read, modify, or delete any workflow the hijacked user has access to, potentially including API keys and credentials stored in the workflow.
  • Integration credentials: if workflows store external service credentials (database passwords, API keys), the attacker can retrieve them from the hijacked user's session.

Map where your company uses AI

Who is exposed

  • n8n instances where any authenticated user can create or edit workflows.
  • Teams where workflow editors include contractors, temporary staff, or users with limited trust.
  • Instances running any version before 1.123.55, or 2.0.0-rc.0 through 2.25.6, or 2.26.0 through 2.26.1.

Upgrades you need

SoftwareAffected versionsMove to
n8n
npm
Every version before 1.123.55; 2.26.0 up to, but not including, 2.26.2; 2.0.0-rc.0 up to, but not including, 2.25.72.26.2 or later

Each maintained branch has its own fixed version. Stay on your branch if you cannot jump to the newest: n8n 1.123.55, 2.25.7, 2.26.2.

Am I affected?

Enter the version you run. Nothing you type is stored.

SecurityElites Developer Brief: the technical picture

Is it being attackedNo known attacks and no public attack code when CISA last reviewed it
Where the attacker must beAnywhere that can reach it over a network, including the internet if it is exposed
Account neededAn ordinary user account
Does a person have to do somethingYes. Someone has to click, open or approve something
How hard it is to doEasy. It works reliably once the attacker can reach it
Risk of: data being readHigh
Risk of: data or settings being changedLimited
Risk of: the service being taken downNone
Can attackers automate it at scaleNo, according to CISA. Each target needs manual work
How much control an attacker gainsPartial control, according to CISA

Read from the official severity rating: CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:L/A:N

Kind of coding mistake

  • CWE-79: script can be injected into a web page

If you cannot upgrade today

  • Limit workflow creation and editing permissions to only fully trusted users until you can upgrade. Remove workflow edit access for any users you do not fully trust.
  • Disable the Respond to Webhook node entirely by setting the environment variable `NODES_EXCLUDE='n8n-nodes-base.respondToWebhook'` and restarting n8n. This prevents anyone from creating or using this node until you upgrade.

Signs it may already have been used against you

  • Review n8n audit logs or activity history for Respond to Webhook nodes created or modified between your current version release date and today.
  • Search for any Respond to Webhook node configuration that includes a custom Content-Type header, especially values like 'text/html' or 'application/javascript' on nodes that return binary or non-JSON content.
  • Check n8n's webhook logs or proxy logs (if any reverse proxy sits in front of n8n) for requests to Respond to Webhook URLs from authenticated user browsers, especially requests that resulted in content serving rather than a standard webhook
  • Look for any user sessions created or modified within a few minutes after a Respond to Webhook node was accessed, which could indicate session hijacking.

SecurityElites Fix Guide: step by step

  1. Find where n8n is runningList all servers or containers running n8n. Check your deployment documentation, container registry, or infrastructure monitoring to find each instance and note which version is installed on each.
  2. Check the current n8n versionRecord which instances need an upgrade.
  3. Test the upgrade in a non-production environmentIf you have a staging or test instance of n8n, upgrade it to the fixed version first (1.123.55, 2.25.7, or 2.26.2 depending on your current branch). Run your existing workflows to confirm they still work correctly.
  4. Upgrade n8n to a fixed versionOn each production n8n instance, upgrade to version 1.123.55, 2.25.7, or 2.26.2 or later, depending on which release branch you are on. Follow your package manager's or container registry's upgrade procedure (npm update, Helm chart upgrade, or container image pull).
  5. Restart n8nAfter upgrading, restart the n8n service on each server or redeploy the container. Wait for n8n to fully start up and confirm it is accepting connections before moving to the next step.
  6. Confirm the fix is activeCheck the About page or run the version command again on each instance to confirm the installed version is now 1.123.55, 2.25.7, 2.26.2 or later. All instances should report a fixed version.
  7. Check for signs of previous misuseReview audit logs or workflow history for any unusual Respond to Webhook nodes created or modified by users. Look for webhooks with custom Content-Type headers or any suspicious activity between the first affected version and your upgrade date. If found, review what that webhook was used for and whether any authenticated users visited the malicious URL.
  8. Review workflow editing permissionsCheck which users or roles have permission to create and edit workflows. Consider whether all of them are trusted. If any users should no longer have this permission, revoke it in the n8n access control settings.

How to confirm it is fixed: Confirm that all n8n instances are running version 1.123.55, 2.25.7, 2.26.2, or later by checking the About page or using the version command on each server.

SecurityElites Quick Fixes: copy and paste

Upgrade n8n with npmupgrade

npm install n8n@2.26.2
npm ls n8n

Check n8n version on a Linux or Mac serverfor this issue

npm list n8n 2>/dev/null | grep n8n | head -1

Check n8n version in a running containerfor this issue

docker exec <container-name> npm list n8n 2>/dev/null | grep n8n | head -1

Disable Respond to Webhook node as a temporary workaroundfor this issue

export NODES_EXCLUDE='n8n-nodes-base.respondToWebhook'

A starting content security policy (nginx)general hardening

add_header Content-Security-Policy "default-src 'self'; object-src 'none'; base-uri 'self'" always;

Test in a non-production environment first. General hardening examples use placeholder names and ports; change them to match your setup.

Let your AI coding assistant do the upgrade

Paste this into the coding assistant you already use, inside the project. It checks first and asks before it changes anything.

Instruction for your coding assistant

You are helping me fix a security vulnerability (CVE-2026-54301) in this project.\n\n1. Search the whole repository, including lock files, container files and CI configuration, for these packages and list every place they are pinned or installed:\n   - n8n (npm): must be 2.26.2 or later
2. Tell me which version we use now and whether it is affected. Stop and ask me before changing anything.
3. After I agree, raise each one to the safe version, update the lock files, and keep every other dependency as it is.
4. Run the tests and tell me what failed.
5. Give me a short summary of the files you changed that I can put in the pull request.

SecurityElites Incident Drill: could your team handle this?

Four questions to ask in your next team meeting. If any has no clear answer, that is the gap to close.

What would an attacker be able to do after tricking an authenticated user into visiting a malicious webhook URL?A good answer: The attacker would run JavaScript in the user's browser with access to that user's n8n session, allowing them to read data, change settings, modify workflows, and retrieve stored credentials.
Which versions of n8n are affected by this vulnerability?A good answer: Versions before 1.123.55, versions 2.0.0-rc.0 through 2.25.6, and versions 2.26.0 through 2.26.1 are affected; versions 1.123.55, 2.25.7, and 2.26.2 or later are fixed.
What is the minimum permission level an attacker needs to set up the malicious webhook?A good answer: An attacker needs to be an authenticated user with permission to create or edit workflows in n8n.
What is a temporary workaround if we cannot upgrade immediately?A good answer: Restrict workflow editing permissions to only fully trusted users and disable the Respond to Webhook node using the `NODES_EXCLUDE` environment variable; however, these do not fully fix the problem and should only be short-term steps.

Run a full timed drill with your team

Ticket for your backlog

Paste into Jira, GitHub Issues or any tracker that reads Markdown.

Ready-made ticket

## n8n webhook node can run JavaScript as an authenticated user (CVE-2026-54301)

**Severity:** High  |  **SE Fix-First Score:** 43/100  |  **Fix window:** Within 30 days
**Record:** SE-AIV-01833 https://securityelites.com/ai-vulnerabilities/cve-2026-54301-n8n-webhook-node-can-run-javascript-as-an-authenticated/

### Why this matters
An attacker with permission to edit workflows in n8n can set up a webhook that runs JavaScript code in the browser of any authenticated user who visits it. This code runs with full access to that user's session, which means the attacker could read data, change settings, or take actions as that user.

### What to do
1. Find where n8n is running
2. Check the current n8n version
3. Test the upgrade in a non-production environment
4. Upgrade n8n to a fixed version
5. Restart n8n
6. Confirm the fix is active
7. Check for signs of previous misuse
8. Review workflow editing permissions

Full steps: https://securityelites.com/ai-vulnerabilities/cve-2026-54301-n8n-webhook-node-can-run-javascript-as-an-authenticated/

### Done when
- [ ] n8n is at 2.26.2 or later everywhere it is installed
- [ ] Lock files, container images and CI configuration are updated
- [ ] Confirm that all n8n instances are running version 1.123.55, 2.25.7, 2.26.2, or later by checking the About page or using the version command on each server.
- [ ] Logs were checked for signs of earlier use

SecurityElites Fix Tracker

Record who owns this fix, the date it is due and when it is done, and see everything still open in one list. Free with a SecurityElites account.

Sign in to track this fix

Change history

  • 16 Jun 2026: Made public
  • 2 Dec 2026: Published

Official record

## Impact An authenticated user with workflow edit access could configure a `Respond to Webhook` node to serve binary content with an attacker-controlled `Content-Type`. The binary response path bypassed the central `Content-Security-Policy` sandbox header, allowing a public webhook to execute JavaScript in the n8n origin when visited by an authenticated user, with access to that user's session.## Patches The issue has been fixed in n8n versions 1.123.55, 2.25.7, and 2.26.2. Users should upgrade to one of these versions or later to remediate the vulnerability.## Workarounds If upgrading is not immediately possible, administrators should consider the following temporary mitigations: - Limit workflow creation and editing permissions to fully trusted users only. - Disable the Respond to Webhook node by adding `n8n-nodes-base.respondToWebhook` to the `NODES_EXCLUDE` environment variable.These workarounds do not fully remediate the risk and should only be used as short-term mitigation measures.

Weakness type: CWE-79

Use this record in your own tools

Get this record as JSON

curl https://securityelites.com/wp-json/se-aivd/v1/vulns/CVE-2026-54301

For scanners and pipelines: OSV format · CycloneDX format · API guide · Email alerts · Fix tracker

The plain-language sections were written with AI from the official record, and the upgrade versions come directly from the official data. Last updated 3 Dec 2026. Read the vendor advisory before changing a production system.