CVE-2025-58177
📋 TL;DR
This stored XSS vulnerability in n8n's LangChain Chat Trigger node allows authorized users to inject malicious JavaScript into public chat URLs. When users visit these compromised URLs, the payload executes in their browsers, potentially enabling phishing attacks or data theft. Organizations running n8n versions 1.24.0 through 1.106.0 with public chat access enabled are affected.
💻 Affected Systems
- n8n workflow automation platform
📦 What is this software?
N8n by N8n
⚠️ Risk & Real-World Impact
Worst Case
Attackers steal session cookies, authentication tokens, or sensitive user data from all visitors to compromised public chat URLs, leading to account takeovers and data breaches.
Likely Case
Phishing attacks that capture user credentials or redirect users to malicious sites, potentially compromising individual user accounts.
If Mitigated
Limited to authorized users only, with no public access to chat URLs, reducing attack surface to internal threats only.
🎯 Exploit Status
Requires authorized user access to configure the vulnerable node and enable public access.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 1.107.0
Vendor Advisory: https://github.com/n8n-io/n8n/security/advisories/GHSA-mvh4-2cm2-6hpg
Restart Required: No
Instructions:
1. Update n8n to version 1.107.0 or later using your package manager. 2. Verify the update completed successfully. 3. Test chat trigger functionality.
🔧 Temporary Workarounds
Disable LangChain Chat Trigger Node
allPrevent exploitation by disabling the vulnerable @n8n/n8n-nodes-langchain.chatTrigger node.
🧯 If You Can't Patch
- Disable public access to all chat trigger nodes in n8n configuration.
- Implement strict Content Security Policy (CSP) headers to mitigate XSS impact.
🔍 How to Verify
Check if Vulnerable:
Check n8n version and verify if running between 1.24.0 and 1.106.0 inclusive.
Check Version:
npx n8n --version
Verify Fix Applied:
Confirm n8n version is 1.107.0 or later and test chat trigger functionality.
📡 Detection & Monitoring
Log Indicators:
- Unusual chat trigger configurations with JavaScript payloads in initialMessages field
- Multiple failed attempts to access chat trigger nodes
Network Indicators:
- Unexpected JavaScript execution in chat responses
- Suspicious outbound connections from chat pages
SIEM Query:
source="n8n" AND ("initialMessages" CONTAINS "<script>" OR "initialMessages" CONTAINS "javascript:")