Skip to content

Stored XSS in n8n Form Trigger allows Account Takeover via injected iframe and video/source

High severity GitHub Reviewed Published Aug 19, 2025 in n8n-io/n8n • Updated Aug 19, 2025

Package

npm n8n (npm)

Affected versions

>= 1.77.0, < 1.98.2

Patched versions

1.98.2

Description

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

References

@csuermann csuermann published to n8n-io/n8n Aug 19, 2025
Published to the GitHub Advisory Database Aug 19, 2025
Reviewed Aug 19, 2025
Published by the National Vulnerability Database Aug 19, 2025
Last updated Aug 19, 2025

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
Low
User interaction
Required
Scope
Changed
Confidentiality
High
Integrity
High
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N

EPSS score

Exploit Prediction Scoring System (EPSS)

This score estimates the probability of this vulnerability being exploited within the next 30 days. Data provided by FIRST.
(7th percentile)

Weaknesses

Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. Learn more on MITRE.

CVE ID

CVE-2025-52478

GHSA ID

GHSA-hfmv-hhh3-43f2

Source code

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.