CVE-2025-58177: Stored XSS in n8n LangChain Chat Trigger Node via initialMessages Parameter
n8n versions from 1.24.0 up to 1.107.0 have a stored XSS in the Chat Trigger node (@n8n/n8n-nodes-langchain.chatTrigger). A user who can edit workflows can put script in the initialMessages field, and it runs in the browser of anyone who opens the public chat URL. Fixed in 1.107.0.
Published Sep 15, 2025 · Analysis Nov 9, 2026
What an attacker can do
The Chat Trigger node can publish a chat page at a public URL. Its initialMessages field holds the greeting lines shown when the chat loads. In affected versions, the field was written into the page without enough escaping, so JavaScript placed there executes for every visitor.
The attacker needs an n8n account that can create or edit workflows and enable public access on the node. That is why the CVSS vector requires low privileges. The victims are people who open the public chat link: customers, staff or anonymous visitors. The script can phish them with a fake form inside a trusted domain, or read cookies and other data available to the n8n origin. The scope is marked changed because the victims are other users of the page, not the editor.
The impact scored here is low (4.1): partial confidentiality loss and no integrity or availability effect. In a team where many people may edit workflows, this matters because the page is served from the same host as the n8n instance.
Who is affected
n8n from 1.24.0 up to, but not including, 1.107.0. Only workflows that use the Chat Trigger node with public access are exposed. Check the version:
npm ls n8n
n8n --versionFor Docker, check the image tag. In the editor, list workflows that contain a Chat Trigger node with Make Chat Publicly Available turned on, and read their initial messages.
n8n
- Ecosystem
- npm
- Affected
- >= 1.24.0, < 1.107.0
- Fixed in
- 1.107.0
- Check
npm ls n8n
How to fix it
Upgrade to n8n 1.107.0 or later:
npm install -g n8n@latestThe fix is pull request 18148, commit d4ef191be0b39b65efa68559a3b8d5dad2e102b2, titled "Prevent XSS vulnerabilities and improve parameter validation". The visible diff checks that initialMessages is a string and hands the raw value to the page template, where the escaping presumably happens; the commit page does not show that file.
The advisory gives one workaround: disable the Chat Trigger node (n8n-nodes-langchain.chatTrigger) using n8n's node-blocking setting, as described in the n8n docs on blocking nodes.
How to tell if you were hit
Review every Chat Trigger node with public access and read its initialMessages value for script tags, event-handler attributes such as onerror, javascript: URLs or odd HTML. Check workflow edit history and the user list to see who changed those nodes. Look at access logs for the public chat URLs and for visitors reporting pop-ups or redirects. Rotate sessions for users who opened a suspect chat link.
Original advisory
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.
Questions
- Who can plant the payload in n8n CVE-2025-58177?
An authorized user who can configure the Chat Trigger node and enable public access. A visitor with no account cannot set initialMessages.
- Which version fixes it?
n8n 1.107.0. Versions from 1.24.0 up to 1.107.0 are affected.
- Is there a workaround?
Yes. Disable the n8n-nodes-langchain.chatTrigger node by blocking it, following the n8n docs on blocking nodes.
- Is it exploited in the wild?
No source we read reports exploitation, and the entry has no CISA KEV record.
References
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. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. 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
