CVE-2025-66222
📋 TL;DR
DeepChat versions 0.5.0 and earlier contain a stored XSS vulnerability in the Mermaid diagram renderer that allows attackers to execute arbitrary JavaScript. This can be escalated to remote code execution via the exposed Electron IPC bridge by registering malicious MCP servers. All users running vulnerable versions are affected.
💻 Affected Systems
- DeepChat
📦 What is this software?
Deepchat by Thinkinai
⚠️ Risk & Real-World Impact
Worst Case
Full system compromise via RCE allowing attacker to execute arbitrary code on the host system, potentially leading to data theft, lateral movement, or complete system takeover.
Likely Case
Stored XSS leading to session hijacking, credential theft, or limited data exfiltration from within the application context.
If Mitigated
XSS payloads are sanitized or blocked, preventing JavaScript execution and subsequent RCE escalation.
🎯 Exploit Status
Exploitation requires user interaction (viewing malicious content) but the XSS-to-RCE chain is documented in the advisory.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 0.5.1 or later
Vendor Advisory: https://github.com/ThinkInAIXYZ/deepchat/security/advisories/GHSA-v8v5-c872-mf8r
Restart Required: Yes
Instructions:
1. Update DeepChat to version 0.5.1 or later. 2. Restart the application. 3. Verify the fix by checking the version number.
🔧 Temporary Workarounds
Disable Mermaid diagram functionality
allTemporarily disable Mermaid diagram rendering to prevent XSS exploitation
Content Security Policy
allImplement strict CSP headers to block inline script execution
🧯 If You Can't Patch
- Isolate DeepChat instances on separate network segments with strict egress filtering
- Implement application allowlisting and monitor for suspicious process creation
🔍 How to Verify
Check if Vulnerable:
Check DeepChat version in application settings or about dialog. Versions 0.5.0 or earlier are vulnerable.
Check Version:
Check application settings or run: deepchat --version (if available)
Verify Fix Applied:
Verify version is 0.5.1 or later. Test Mermaid diagram functionality with known safe diagrams.
📡 Detection & Monitoring
Log Indicators:
- Unusual Mermaid diagram content with JavaScript payloads
- Suspicious IPC bridge activity
- Unexpected MCP server registration
Network Indicators:
- Outbound connections to unexpected MCP servers
- Unusual process spawning from DeepChat
SIEM Query:
process_name:deepchat AND (event_type:process_creation OR event_type:network_connection)