Browse / AI Framework and Platform Flaws / CVE-2025-58177
Stored XSS in n8n LangChain Chat Trigger Node via initialMessages Parameter
- Class
- AI Framework and Platform Flaws (filed by a model that read the advisory)
- Technique
- Cross-site scripting
- Affected
- n8n (npm)
- CVSS
- CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:N/A:N
- EPSS
- 0.3% chance of exploitation in 30 days
How it works, in short
A script stored in the initial messages setting runs in the browser of every visitor to the public chat page. (Our summary, written by a model. The source text is below.)
Details
Impact
A stored Cross-Site Scripting (XSS) vulnerability was identified in the @n8n/n8n-nodes-langchain.chatTrigger node in n8n. If an authorized user configures the node with malicious JavaScript in the initialMessages field and enables public access, the script will be executed in the browser of anyone who visits the resulting public chat URL.
This vulnerability could be exploited for phishing or to steal cookies or other sensitive data from users who access the public chat link, posing a security risk.
Patches
This issue has been patched in version 1.107.0 of n8n. Users should upgrade to version 1.107.0 or later.
Workarounds
Disabling the n8n-nodes-langchain.chatTrigger node (docs)
References
#18148
References
- https://github.com/n8n-io/n8n/security/advisories/GHSA-mvh4-2cm2-6hpg
- https://nvd.nist.gov/vuln/detail/CVE-2025-58177
- https://github.com/n8n-io/n8n/pull/18148
- https://github.com/n8n-io/n8n/commit/d4ef191be0b39b65efa68559a3b8d5dad2e102b2
- https://docs.n8n.io/hosting/securing/blocking-nodes
- https://github.com/n8n-io/n8n
Source: GitHub Advisory Database, used under CC BY 4.0.