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.
Risk Assessment
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.
Affected Systems
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| n8n | npm | — | No patch |
Do you use n8n? You're affected.
Severity & Risk
Attack Surface
Recommended Action
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.
CISA SSVC Assessment
Source: CISA Vulnrichment (SSVC v2.0). Decision based on the CISA Coordinator decision tree.
Classification
Compliance Impact
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.03%.
Technical Details
NVD Description
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)
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
AI Threat Alert