CVE-2025-52478: n8n: Stored XSS enables full account takeover
MEDIUMUpgrade n8n to 1.98.2 immediately if your organization uses it for workflow automation or AI agent orchestration. An authenticated attacker with minimal privileges can plant a malicious Form Trigger that silently steals session cookies from any user who visits it, enabling persistent account takeover—including admin accounts with full access to every stored API key and external service credential. If 2FA is not enforced, compromise is silent and permanent until credentials are rotated.
What is the risk?
Despite a CVSS 5.4 (Medium) rating, the practical risk is materially higher for organizations using n8n in agentic or automation contexts. The CVSS reflects network-reachable, low-complexity exploitation requiring only low privileges and one user interaction. However, n8n instances routinely store API keys for AI model endpoints, cloud services, databases, and SaaS platforms as workflow credentials. Full ATO on an n8n admin translates directly into credential exposure across every integrated system. Organizations without enforced 2FA are at highest risk; the attack leaves no obvious trace and the session remains valid until explicitly revoked.
What systems are affected?
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| n8n | npm | — | No patch |
Do you use n8n? You're affected.
How severe is it?
What is the attack surface?
What should I do?
7 steps-
Patch immediately: upgrade n8n to >= 1.98.2. No functional workaround exists for older versions.
-
Enforce 2FA for all n8n users, especially admins—this significantly limits the utility of stolen session cookies for account takeover.
-
Audit n8n credential store post-incident: rotate all API keys, OAuth tokens, and service account passwords stored in any n8n instance that may have been targeted.
-
Review Form Trigger workflows: identify any active Form Trigger nodes and audit who created them and whether they contain suspicious HTML payloads.
-
Restrict Form Trigger creation to trusted users via n8n RBAC.
-
Implement a Web Application Firewall (WAF) rule blocking iframe srcdoc patterns and onerror event handlers in form submissions as a defense-in-depth layer.
-
Monitor n8n audit logs for unusual email/account changes, workflow modifications, or credential access from unexpected source IPs.
What does CISA's SSVC say?
Source: CISA Vulnrichment (SSVC v2.0). Decision based on the CISA Coordinator decision tree.
How is it classified?
Which compliance frameworks are affected?
This CVE is relevant to:
Frequently Asked Questions
What is CVE-2025-52478?
Upgrade n8n to 1.98.2 immediately if your organization uses it for workflow automation or AI agent orchestration. An authenticated attacker with minimal privileges can plant a malicious Form Trigger that silently steals session cookies from any user who visits it, enabling persistent account takeover—including admin accounts with full access to every stored API key and external service credential. If 2FA is not enforced, compromise is silent and permanent until credentials are rotated.
Is CVE-2025-52478 actively exploited?
No confirmed active exploitation of CVE-2025-52478 has been reported, but organizations should still patch proactively.
How to fix CVE-2025-52478?
1. Patch immediately: upgrade n8n to >= 1.98.2. No functional workaround exists for older versions. 2. Enforce 2FA for all n8n users, especially admins—this significantly limits the utility of stolen session cookies for account takeover. 3. Audit n8n credential store post-incident: rotate all API keys, OAuth tokens, and service account passwords stored in any n8n instance that may have been targeted. 4. Review Form Trigger workflows: identify any active Form Trigger nodes and audit who created them and whether they contain suspicious HTML payloads. 5. Restrict Form Trigger creation to trusted users via n8n RBAC. 6. Implement a Web Application Firewall (WAF) rule blocking iframe srcdoc patterns and onerror event handlers in form submissions as a defense-in-depth layer. 7. Monitor n8n audit logs for unusual email/account changes, workflow modifications, or credential access from unexpected source IPs.
What systems are affected by CVE-2025-52478?
This vulnerability affects the following AI/ML architecture patterns: agent frameworks, workflow automation pipelines, API integration layers, RAG pipelines, model serving orchestration.
What is the CVSS score for CVE-2025-52478?
CVE-2025-52478 has a CVSS v3.1 base score of 5.4 (MEDIUM). The EPSS exploitation probability is 0.35%.
What is the AI security impact?
Affected AI Architectures
MITRE ATLAS Techniques
AML.T0012 Valid Accounts AML.T0025 Exfiltration via Cyber Means AML.T0049 Exploit Public-Facing Application AML.T0053 AI Agent Tool Invocation AML.T0078 Drive-by Compromise AML.T0083 Credentials from AI Agent Configuration AML.T0091.000 Application Access Token Compliance Controls Affected
What are the technical details?
Original Advisory
n8n is a workflow automation platform. From 1.77.0 to before 1.98.2, 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. Users should upgrade to version >= 1.98.2.
Exploitation Scenario
An attacker with a low-privilege n8n account (e.g., obtained via credential stuffing or insider access) creates a workflow with a Form Trigger node containing a crafted HTML form. The form embeds an iframe with a srcdoc payload executing JavaScript that reads document.cookie and the n8n-browserId value, then exfiltrates them via a fetch() call to an attacker-controlled server. The attacker shares the form URL—plausibly as a legitimate-looking data collection form—with a high-privilege user or admin (via phishing, Slack, or email). When the target opens the form in their authenticated browser session, the script fires silently and delivers the session tokens. The attacker imports the stolen cookies into their browser, assumes the victim's identity, navigates to account settings, changes the email address to one they control, and locks out the legitimate user. With admin access to n8n, the attacker then exports all stored workflow credentials—API keys for connected AI services, cloud providers, and internal databases—completing a full supply chain pivot from a single low-privilege n8n account.
Weaknesses (CWE)
CWE-79 — 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.
- [Architecture and Design] Use a vetted library or framework that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid [REF-1482]. Examples of libraries and frameworks that make it easier to generate properly encoded output include Microsoft's Anti-XSS library, the OWASP ESAPI Encoding module, and Apache Wicket.
- [Implementation, Architecture and Design] Understand the context in which your data will be used and the encoding that will be expected. This is especially important when transmitting data between different components, or when generating outputs that can contain multiple encodings at the same time, such as web pages or multi-part mail messages. Study all expected communication protocols and data representations to determine the required encoding strategies. For any data that will be output to another web page, especially any data that was received from external inputs, use the appropriate encoding on all non-alphanumeric characters. Parts of the same output document may require different encodings, which will vary depending on whether the output is in the: etc. Note that HTML Entity Encoding is only appropriate for the HTML body. Consult the XSS Prevention Cheat Sheet [REF-724] for more details on the types of encoding and escaping that are needed. HTML body Element attributes (such as src="XYZ") URIs JavaScript sections Casca
Source: MITRE CWE corpus.
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N References
Timeline
Related Vulnerabilities
CVE-2026-33663 10.0 n8n: member role steals plaintext HTTP credentials
Same package: n8n CVE-2026-33660 10.0 TensorFlow: type confusion NPD in tensor conversion
Same package: n8n CVE-2026-21858 10.0 n8n: Input Validation flaw enables exploitation
Same package: n8n CVE-2026-27577 9.9 n8n: Code Injection enables RCE
Same package: n8n CVE-2026-27494 9.9 n8n: security flaw enables exploitation
Same package: n8n