Executive brief
n8n is a workflow automation tool used to connect different software services. A security vulnerability in its HTML preview feature allows a malicious user to execute unauthorized commands. If a victim views a specially crafted preview, the attacker can hijack their session to access sensitive data or perform actions on their behalf within the n8n platform.
Technical details
A DOM-based Cross-Site Scripting (XSS) vulnerability exists in n8n's HTML previewer. The application renders execution output into an 'iframe srcdoc' without the 'sandbox' attribute. By bypassing the HTML sanitizer, an attacker can inject malicious JavaScript that executes within the same origin as the n8n editor. Exploitation requires the attacker to have 'global:member' privileges to create the malicious workflow and requires a victim to view the HTML preview. Once triggered, the script can make authenticated API calls using the victim's active session. The issue is resolved in versions 1.123.64, 2.29.8, and 2.30.1.
Affected products
- n8n-io n8n < 1.123.64, >= 2.0.0-rc.0 < 2.29.8, >= 2.30.0 < 2.30.1
Timeline
- 2026-07-08: disclosed
- 2026-07-22: advisory