n8n HTML preview can run attacker scripts with user permissions
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 Score | 43 of 100 Our own ranking of what to fix first. Real attacks count most, then the chance of attack, then severity. |
|---|---|
| SecurityElites fix window | Within 30 days High severity. This is our suggestion from common practice; your own policy comes first. |
| Who should own the fix | Platform or infrastructure team responsible for n8n deployment and updates. |
| Likely effort | About 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-01809What 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.
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
| Software | Affected versions | Move 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.8 | 2.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 attacked | No known attacks and no public attack code when CISA last reviewed it |
|---|---|
| Where the attacker must be | Anywhere that can reach it over a network, including the internet if it is exposed |
| Account needed | An ordinary user account |
| Does a person have to do something | Yes, a deliberate action by a user |
| How hard it is to do | Easy. It works reliably once the attacker can reach it |
| Risk of: data being read | High |
| Risk of: data or settings being changed | Limited |
| Risk of: the service being taken down | None |
| Can attackers automate it at scale | No, according to CISA. Each target needs manual work |
| How much control an attacker gains | Partial 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, timestampWorkflow 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 > 10Written 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
- 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.
- 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.
- 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.
- 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.
- 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.
- Confirm the upgrade workedLog in to n8n and check Settings to confirm the version number has changed to the fixed version you installed.
- 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.
- 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 n8nCheck n8n version from command line (npm global install)for this issue
npm list -g n8n | grep n8nCheck n8n version from Docker containerfor this issue
docker exec <container_id> npm list n8nA 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.
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.
Related vulnerabilities
In the same software
- n8n legacy expression engine allows code execution via JSON.stringify override High · CVE-2026-86083
- n8n OpenAI node bypasses domain restrictions on model search High · CVE-2026-86082
- n8n Git node can freeze the instance with a crafted path High · CVE-2026-86081
- n8n OAuth registration accepts unlimited field sizes, filling the database High · CVE-2026-86075
- n8n expression compiler can run arbitrary code through class field names High · CVE-2026-86076
- n8n Edit Fields node can crash the whole instance with a bad field name High · CVE-2026-72749
The same kind of mistake in other AI tools
- n8n can run JavaScript in a user's browser when they open a crafted workflow High · CVE-2026-65592
- Flowise stores user messages without sanitizing them, letting attackers run scripts in admin browser Critical · CVE-2025-50538
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-65597For 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.