Browse / AI Framework and Platform Flaws / CVE-2025-52478
Stored XSS in n8n Form Trigger allows Account Takeover via injected iframe and video/source
- Class
- AI Framework and Platform Flaws (filed by a model that read the advisory)
- Technique
- Cross-site scripting
- Affected
- n8n (npm)
- CVSS
- CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N
- EPSS
- 0.4% chance of exploitation in 30 days
How it works, in short
An authenticated user stores HTML in a form trigger using iframe srcdoc or video and source onerror payloads, which run in victims' browsers and steal session tokens. (Our summary, written by a model. The source text is below.)
Details
Impact
A stored Cross-Site Scripting (XSS) vulnerability was identified in n8n, specifically in the Form Trigger node's HTML form element. An authenticated attacker can inject malicious HTML via an <iframe> with a srcdoc payload that includes arbitrary JavaScript execution. The attacker can also inject malicious Javascript by using <video> coupled <source> using an onerror event.
While using iframe or a combination of video and source tag, this vulnerability allows for Account Takeover (ATO) by exfiltrating n8n-browserId and session cookies from authenticated users who visit a maliciously crafted form. Using these tokens and cookies, an attacker can impersonate the victim and change account details such as email addresses, enabling full control over the account—especially if 2FA is not enabled.
Patches
The issue was addressed in PR #16329. Users should upgrade to version >=1.98.2.
Workarounds
Apart from updating to the fixed version, n8n instance administrators can: - Configure a reverse proxy to serve webhook requests from a different domain [docs]. - Disable or restrict use of the Form Trigger node, particularly the HTML element type. - Use a Content Security Policy (CSP) to block execution of inline scripts and disallow use of srcdoc.
References
- OWASP XSS Prevention Cheat Sheet - MDN: iframe srcdoc attribute - HTML: onerror attribute
References
- https://github.com/n8n-io/n8n/security/advisories/GHSA-hfmv-hhh3-43f2
- https://nvd.nist.gov/vuln/detail/CVE-2025-52478
- https://github.com/n8n-io/n8n/pull/16329
- https://github.com/n8n-io/n8n/commit/7940384a85041a1890b1203d69c092c887312500
- https://github.com/n8n-io/n8n
Source: GitHub Advisory Database, used under CC BY 4.0.