Stored XSS in n8n Form Trigger allows Account Takeover via injected iframe and video/source
High8.7CVE-2025-52478 · Published Aug 19, 2025
### Impact A stored **Cross-Site Scripting (XSS)** vulnerability was identified in [n8n](https://github.com/n8n-io/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](https://github.com/n8n-io/n8n/pull/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](https...
Affected versions
| Package | Affected | Fixed in |
|---|---|---|
| n8n npm | >= 1.77.0, < 1.98.2 | 1.98.2 |
Details and references
### Impact A stored **Cross-Site Scripting (XSS)** vulnerability was identified in [n8n](https://github.com/n8n-io/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](https://github.com/n8n-io/n8n/pull/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](https://docs.n8n.io/hosting/configuration/configuration-examples/webhook-url/)]. - 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](https://cheatsheetseries.owasp.org/cheatsheets/XSS_Prevention_Cheat_Sheet.html) - [MDN: iframe `srcdoc` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#attr-srcdoc) - [HTML: `onerror` attribute](https://html.spec.whatwg.org/multipage/webappapis.html#handler-onerror)
- CVSS 3.1
- CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N
- Severity from
- GitHub (reviewed advisory)
- Weakness
- CWE-79
- Also known as
- CVE-2025-52478
More n8n advisories
All n8n| Date | Advisory | Severity | Fixed in |
|---|---|---|---|
| Oct 92025 | n8n: Execute Command Node Allows Authenticated Users to Run Arbitrary Commands on Host | High8.8 | No fix yet |
| Sep 152025 | Stored XSS in n8n LangChain Chat Trigger Node via initialMessages Parameter | Medium4.1 | 1.107.0 |
| Aug 202025 | n8n symlink traversal vulnerability in "Read/Write File" node allows access to restricted files | Medium6.5 | 1.106.0 |
| Jul 32025 | n8n is vulnerable to Improper Authorization through its `/stop` endpoint | Medium4.3 | 1.99.1 |
| Jul 32025 | n8n Vulnerable to Denial of Service via Malformed Binary Data Requests | Medium4.9 | 1.99.0 |
| Jun 272025 | n8n allows open redirects via the /signin endpoint | Medium4.6 | 1.98.0 |