n8n HTML preview can run attacker scripts with user permissions

HighSE Fix-First Score 43/100CVE-2026-65597SE-AIV-01809Script injection in the browserAI softwareMade public 22 Jul 2026

Download as PDF

What this means

An attacker with basic member access to an n8n instance can run JavaScript in the browser when a user previews workflow output. The script runs with the same permissions as the logged-in user, so it can read data, trigger workflows, change settings, or steal the user's session token.

SecurityElites Manager Brief: the decision in one minute

An n8n user with basic access can inject code that runs in other users' browsers, hijacking their sessions and stealing their data. Upgrade to version 1.123.64, 2.29.8, or 2.30.1 or later immediately, and review recent workflow changes for signs of exploitation.

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 responsible for n8n deployment and updates.
Likely effortAbout 15 to 30 minutes: check which n8n version is installed, upgrade to the fixed version, and restart the service. It could take longer if you run multiple n8n instances or use a containerized deployment that requires image rebuilds.

Questions to ask your team or supplier

  • Which n8n version is currently deployed in production, and do we have a process to track and update dependencies regularly?
  • Who has access to edit and preview workflows in our n8n instance, and do we audit their actions?
  • What external data or user input do our workflows render into HTML previews, and could that data be controlled by an attacker?

Message you can forward to the owning team

Security notice: n8n HTML preview can run attacker scripts with user permissions (CVE-2026-65597)

Severity: High
SecurityElites Fix-First Score: 43 of 100
SecurityElites fix window: Within 30 days
Action: upgrade to n8n 2.30.1 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-65597-n8n-html-preview-can-run-attacker-scripts-with-user/
Source: SecurityElites AI Vulnerabilities Database, record SE-AIV-01809

What is at stake in your AI setup

  • Keys and tokens for external AI services (Claude, OpenAI, etc.) stored in n8n credentials could be stolen if an attacker gains access through this vulnerability.
  • Prompts and instructions used in AI nodes are exposed to the attacker and could reveal your business logic or model usage patterns.
  • Training or retrieval data that flows through workflows could be read and exfiltrated by injected scripts.
  • Tools and systems connected to n8n agents (APIs, databases, services) can be called by the attacker using the compromised user's permissions.

Map where your company uses AI

Who is exposed

  • n8n instances running version 1.123.63 or earlier, 2.29.7 or earlier, or 2.30.0
  • Teams sharing n8n instances with colleagues who preview workflow output
  • Workflows that render external data, HTML node output, or binary data in preview
  • Accounts with global:member role or higher that can edit workflows

Upgrades you need

SoftwareAffected versionsMove to
n8n
npm
Every version before 1.123.64; 2.30.0 up to, but not including, 2.30.1; 2.0.0-rc.0 up to, but not including, 2.29.82.30.1 or later

Each maintained branch has its own fixed version. Stay on your branch if you cannot jump to the newest: n8n 1.123.64, 2.29.8, 2.30.1.

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, a deliberate action by a user
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:4.0/AV:N/AC:L/AT:N/PR:L/UI:A/VC:H/VI:L/VA:N/SC:H/SI:L/SA:N

Kind of coding mistake

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

If you cannot upgrade today

  • Restrict n8n instance access to fully trusted users only until you can upgrade.
  • Set the `N8N_CONTENT_SECURITY_POLICY` environment variable to a strict policy that blocks inline scripts.
  • Do not preview workflows that render external data or user input in HTML preview until you upgrade.

Signs it may already have been used against you

  • Check workflow execution logs for unusual API calls that happened around the time users opened HTML previews.
  • Look for workflows that were modified by users who do not normally edit them, especially if changes added HTML nodes or modified preview output.
  • Review authentication logs for accounts that accessed the API or made changes at times when those users were not actively working.
  • Search for any new or modified workflows that render `{{ }}` variables or external data into HTML preview nodes.

Log searches to start from

API calls made during HTML preview access (field names must be adapted to your logs)Elastic

process=n8n AND action=preview AND method=GET AND status!=404 | stats count by user, workflow_id, timestamp

Workflow modifications by users who do not normally edit (field names must be adapted)Splunk

source=n8n workflow_action=modified | stats first(user), count by workflow_id | where count > 10

Written with AI as a starting point. Review them and change the index and field names to match your own logs before you rely on the result.

SecurityElites Fix Guide: step by step

  1. Find the n8n version you are runningLog in to your n8n instance. Go to Settings (gear icon) and scroll to the bottom to see the version number. Write down the full version.
  2. Check if your version is affectedIf your version is 1.123.63 or earlier, or 2.29.7 or earlier, or exactly 2.30.0, then you are affected. All other versions are not affected by this issue.
  3. Back up your n8n data and settingsExport your workflows and credentials or take a database snapshot, depending on how you run n8n. This protects you if the upgrade encounters problems.
  4. Upgrade n8n to a fixed versionUpgrade to version 1.123.64, 2.29.8, or 2.30.1 or later, depending on which release line you use. Use your package manager or container system to perform the upgrade following your normal deployment process.
  5. Restart the n8n serviceStop and start the n8n service, or redeploy the container. Wait for it to fully start before moving to the next step.
  6. Confirm the upgrade workedLog in to n8n and check Settings to confirm the version number has changed to the fixed version you installed.
  7. Review access and audit logsCheck who has access to your n8n instance and what they have done recently. Look for any workflows that may have been modified without your knowledge, especially those that render HTML or external data.
  8. Invalidate user sessions to force re-loginIf your instance stores session tokens and you are concerned about past exposure, consider clearing active sessions so users must log in again. Check your n8n documentation or contact support for the specific steps for your deployment.

How to confirm it is fixed: Log in to n8n Settings and confirm the version number is 1.123.64 or later, 2.29.8 or later, or 2.30.1 or later.

SecurityElites Quick Fixes: copy and paste

Upgrade n8n with npmupgrade

npm install n8n@2.30.1
npm ls n8n

Check n8n version from command line (npm global install)for this issue

npm list -g n8n | grep n8n

Check n8n version from Docker containerfor this issue

docker exec <container_id> npm list n8n

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-65597) 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.30.1 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 versions of n8n are affected by this vulnerability?A good answer: Versions before 1.123.64, versions 2.0.0-rc.0 through 2.29.7, and version 2.30.0 are affected; 1.123.64, 2.29.8, and 2.30.1 or later are fixed.
What can an attacker do if they exploit this?A good answer: They can run JavaScript in a user's browser with that user's permissions, allowing them to steal session tokens, trigger workflows, read data, or change settings.
Who can exploit this vulnerability?A good answer: An account with global:member privileges or higher can inject code into workflow output that runs when other users open the HTML preview.
What is the first step to protect your instance?A good answer: Check your installed n8n version and upgrade immediately to 1.123.64, 2.29.8, or 2.30.1 or later, then restart the service.

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 HTML preview can run attacker scripts with user permissions (CVE-2026-65597)

**Severity:** High  |  **SE Fix-First Score:** 43/100  |  **Fix window:** Within 30 days
**Record:** SE-AIV-01809 https://securityelites.com/ai-vulnerabilities/cve-2026-65597-n8n-html-preview-can-run-attacker-scripts-with-user/

### Why this matters
An attacker with basic member access to an n8n instance can run JavaScript in the browser when a user previews workflow output. The script runs with the same permissions as the logged-in user, so it can read data, trigger workflows, change settings, or steal the user's session token.

### What to do
1. Find the n8n version you are running
2. Check if your version is affected
3. Back up your n8n data and settings
4. Upgrade n8n to a fixed version
5. Restart the n8n service
6. Confirm the upgrade worked
7. Review access and audit logs
8. Invalidate user sessions to force re-login

Full steps: https://securityelites.com/ai-vulnerabilities/cve-2026-65597-n8n-html-preview-can-run-attacker-scripts-with-user/

### Done when
- [ ] n8n is at 2.30.1 or later everywhere it is installed
- [ ] Lock files, container images and CI configuration are updated
- [ ] Log in to n8n Settings and confirm the version number is 1.123.64 or later, 2.29.8 or later, or 2.30.1 or later.
- [ ] 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

  • 22 Jul 2026: Made public
  • 2 Dec 2026: Published

Official record

## ImpactThe HTML preview renders execution output into an `iframe srcdoc` without `sandbox`, so a sanitizer bypass lets injected script run same-origin as the editor. When a victim opens the preview, it can call authenticated APIs with their session. An account with `global:member` privileges can exploit it.## PatchesThe issue has been fixed in n8n versions 1.123.64, 2.29.8, and 2.30.1. Users should upgrade to one of these versions or later to remediate the vulnerability.## WorkaroundsIf upgrading is not immediately possible, administrators should consider the following temporary mitigations: - Restrict n8n instance access to fully trusted users only. - Set the `N8N_CONTENT_SECURITY_POLICY` environment variable to a policy that blocks inline scripts. - Avoid exposing workflows that render externally-controlled input into the HTML node or binary HTML preview to untrusted users.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-65597

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 2 Dec 2026. Read the vendor advisory before changing a production system.