CVE-2025-52478: n8n: Stored XSS enables full account takeover

MEDIUM
Published August 19, 2025
CISO Take

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.

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
186.5K OpenSSF 6.0 16 dependents Pushed 7d ago 40% patched ~3d to patch Full package profile →

Do you use n8n? You're affected.

Severity & Risk

CVSS 3.1
5.4 / 10
EPSS
0.0%
chance of exploitation in 30 days
Higher than 8% of all CVEs
Exploitation Status
No known exploitation
Sophistication
Trivial

Attack Surface

AV AC PR UI S C I A
AV Network
AC Low
PR Low
UI Required
S Changed
C Low
I Low
A None

Recommended Action

7 steps
  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.

CISA SSVC Assessment

Decision Track
Exploitation none
Automatable No
Technical Impact total

Source: CISA Vulnrichment (SSVC v2.0). Decision based on the CISA Coordinator decision tree.

Classification

Compliance Impact

This CVE is relevant to:

EU AI Act
Article 15 - Accuracy, robustness and cybersecurity Article 9 - Risk management system
ISO 42001
A.6.2.6 - Security of AI system inputs A.8.1 - Security of AI system resources and information
NIST AI RMF
GOVERN 6.1 - Policies for AI risk are established MANAGE 2.2 - Mechanisms are in place to inventory AI risks
OWASP LLM Top 10
LLM05 - Insecure Output Handling

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

Timeline

Published
August 19, 2025
Last Modified
September 3, 2025
First Seen
August 19, 2025

Related Vulnerabilities