NewApp Monitoring is liveSign up free
AgentbeamBeta
AI agent vulnerability · n8n

CVE-2026-65597: n8n: DOM-Based XSS via Unsandboxed iframe srcdoc in HTML Preview

highCVSS 4.0 8.2GHSA-p3rg-hrf9-w9gj

n8n's HTML preview puts workflow execution output into an iframe srcdoc with no sandbox attribute. If an attacker gets script past the sanitizer, it runs with the editor's origin and can call authenticated APIs as the victim. The attacker needs a global:member account and the victim must open the preview. Fixed in n8n 1.123.64, 2.29.8 and 2.30.1.

Published Jul 22, 2026 · Analysis Oct 25, 2026

What an attacker can do

The HTML preview renders execution output inside an iframe using srcdoc. The iframe has no sandbox attribute, so it shares the origin of the n8n editor. The only barrier is the sanitizer. A sanitizer bypass lets injected script run same-origin (CWE-79, DOM-based).

The attacker needs an account with global:member privileges and a way to get content into execution output, for example a workflow that renders externally controlled input in the HTML node or a binary HTML preview. A victim, such as an admin or a workflow owner, must then open that preview. The script runs in the victim's session and can call n8n's authenticated APIs with the victim's rights. The CVSS 4.0 vector rates confidentiality impact as high and integrity as low, with user interaction required.

In practice, a low-privilege member can read data and act as a higher-privilege user on a shared n8n instance. Credentials and workflow data are the likely targets. The advisory gives no proof of concept.

Who is affected

Affected: n8n below 1.123.64 on the 1.x line, 2.0.0-rc.0 up to but not including 2.29.8, and 2.30.0. Instances where untrusted or semi-trusted users hold member accounts, or where workflows render outside input through the HTML node or HTML preview, carry the most risk.

Check the npm install:

npm ls n8n

For Docker, check the version shown in the n8n UI or the image tag.

n8n

Ecosystem
npm
Affected
< 1.123.64
Fixed in
1.123.64
Check
npm ls n8n

n8n

Ecosystem
npm
Affected
>= 2.30.0, < 2.30.1
Fixed in
2.30.1
Check
npm ls n8n

n8n

Ecosystem
npm
Affected
>= 2.0.0-rc.0, < 2.29.8
Fixed in
2.29.8
Check
npm ls n8n

How to fix it

Upgrade to n8n 1.123.64, 2.29.8 or 2.30.1, or later. For an npm install, run npm install [email protected]. For Docker, pull a patched image tag and recreate the container.

If you cannot upgrade yet, the advisory lists short-term mitigations. They do not fully remove the risk:

  • Restrict instance access to fully trusted users.
  • Set N8N_CONTENT_SECURITY_POLICY to a policy that blocks inline scripts.
  • Do not expose workflows that render externally controlled input into the HTML node or binary HTML preview to untrusted users.

How to tell if you were hit

The advisory names no log signature. Review which workflows pass external input into the HTML node or a binary HTML preview. Look for member-created workflows whose output contains script tags or event-handler attributes. Check audit and API logs for unexpected authenticated API calls, such as credential reads or new users and workflows, that follow a preview being opened by an admin or owner.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Impact

The 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.

Patches

The 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.

Workarounds

If 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.

Credited to odgrso.

Questions

Who can exploit GHSA-p3rg-hrf9-w9gj?

An authenticated user with global:member privileges. A victim must also open the malicious HTML preview, so it is not a drive-by attack from an anonymous visitor.

Which n8n versions fix it?

1.123.64, 2.29.8 and 2.30.1. Anything older on the matching line is affected, including 2.0.0-rc.0 and later up to 2.29.7, and 2.30.0.

Does a Content Security Policy fully protect me?

No. Setting N8N_CONTENT_SECURITY_POLICY to block inline scripts is listed as a short-term mitigation only. The advisory says the workarounds do not fully remediate the risk, so upgrade.

Is it exploited in the wild?

The sources do not say so, and the entry is not in CISA's KEV catalog. EPSS is low at 0.003.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology

More n8n vulnerabilities

All n8n entries