CVE-2025-58177: Stored XSS in n8n LangChain Chat Trigger Node via initialMessages Parameter
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.
Published Sep 15, 2025
Affected packages
n8n
- Ecosystem
- npm
- Affected
- >= 1.24.0, < 1.107.0
- Fixed in
- 1.107.0
- Check
npm ls n8n
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
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
Credited to pfelilpe, 5h0lm3s.
References
- https://github.com/n8n-io/n8n/security/advisories/GHSA-mvh4-2cm2-6hpg
- 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://nvd.nist.gov/vuln/detail/CVE-2025-58177
- https://github.com/advisories/GHSA-mvh4-2cm2-6hpg
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More n8n vulnerabilities
All n8n entriesCVE-2026-86073
n8n: Per-Resource OAuth Consent Bypass via Unbound Refresh Token Resource Substitution
medium5.9Sep 10, 2026CVE-2026-86074
n8n: Instance AI Credential Setup Accepts Unvalidated Probe URL from Fetched Content
medium5.9Sep 10, 2026CVE-2026-86075
n8n: Unauthenticated Persistent Storage Exhaustion via OAuth Dynamic Client Registration Endpoint
high8.7Sep 10, 2026CVE-2026-86076
n8n: Expression Sandbox Escape via Class-Field Sanitizer Rebinding Can Lead to Code Execution
high8.7Sep 10, 2026CVE-2026-86077
n8n: Anonymous Approval-Gate Bypass via Reused resumeToken over the Chat WebSocket
medium6.3Sep 10, 2026CVE-2026-86078
n8n: Prototype Pollution via Workflow Structure Summary Can Lead to Denial of Service
medium6.0Sep 10, 2026
