Skip to content

CVE-2025-67744: Critical RCE in DeepChat via Mermaid XSS and Exposed Electron IPC

Overview

A critical security vulnerability, identified as CVE-2025-67744, impacts DeepChat, an open-source artificial intelligence agent platform. This flaw carries a CVSS score of 9.6, indicating its severe potential impact. The vulnerability stems from an insecure configuration within DeepChat’s Mermaid diagram rendering component, which facilitates Cross-Site Scripting (XSS). This XSS, when coupled with the exposure of the Electron Inter-Process Communication (IPC) renderer to the Document Object Model (DOM), escalates directly to full Remote Code Execution (RCE). Attackers can leverage this chain to execute arbitrary system commands on affected systems. All DeepChat versions prior to 0.5.3 are susceptible to this critical issue. The development team has released version 0.5.3, which includes a patch addressing both root causes of the vulnerability.

Technical Details

The attack vector for CVE-2025-67744 is a sophisticated two-stage exploit. The initial entry point resides within the Mermaid diagram rendering component integrated into DeepChat. Mermaid, a JavaScript-based diagramming tool, can parse and render various types of diagrams from text-based definitions. In vulnerable DeepChat versions, the configuration for Mermaid was insufficiently hardened, allowing for the injection and execution of arbitrary JavaScript code through specially crafted diagram definitions. This constitutes the Cross-Site Scripting (XSS) vulnerability.

The true criticality of this flaw emerges from its immediate escalation to Remote Code Execution (RCE). DeepChat, being an Electron-based application, operates within a Node.js runtime environment. A fundamental security principle for Electron applications is to strictly limit the exposure of Node.js primitives and Electron IPC interfaces to the renderer process (the web context). However, in DeepChat versions prior to 0.5.3, the Electron IPC renderer was exposed directly to the DOM. This critical misconfiguration allows JavaScript executed in the renderer process (via the XSS) to interact with the underlying Node.js environment and Electron’s IPC mechanisms. An attacker exploiting the XSS can therefore invoke privileged Electron APIs or Node.js functions, effectively breaking out of the web sandbox and executing arbitrary commands on the host operating system.

The confluence of these two distinct, yet equally critical, issues—an unsafe Mermaid configuration enabling arbitrary JavaScript execution, and an exposed Electron IPC interface—creates a direct path from a seemingly benign XSS to a devastating RCE. An attacker with the ability to inject malicious Mermaid diagram definitions into DeepChat can achieve complete system compromise. This poses an extreme risk, especially for a platform designed to unify AI models, tools, and agents, potentially giving an attacker control over sensitive AI operations or data.

Affected Systems

The vulnerability specifically impacts the DeepChat open-source artificial intelligence agent platform. All versions of DeepChat released prior to version 0.5.3 are vulnerable to CVE-2025-67744. Users and organizations deploying DeepChat instances running any version older than 0.5.3 must consider their systems at critical risk.

Remediation

Immediate action is imperative for all DeepChat users and administrators. To mitigate the risk posed by CVE-2025-67744, apply the following remediation steps:

  • Upgrade DeepChat: The primary and most effective mitigation is to upgrade your DeepChat installation to version 0.5.3 or later. This version contains the necessary patches to address both the unsafe Mermaid configuration and the exposed Electron IPC interface.
  • Review Electron Security Best Practices: For developers and administrators running custom Electron applications or forks, review and enforce Electron’s security best practices, particularly regarding context isolation and the secure handling of IPC. Ensure that Node.js integration is disabled for untrusted content and that only necessary, sanitized APIs are exposed to the renderer process via a secure preload script.
  • Implement Content Security Policies (CSP): While not a direct fix for this specific RCE, robust Content Security Policies (CSPs) can significantly reduce the impact of XSS vulnerabilities by restricting the sources from which scripts and other resources can be loaded and executed.
  • Input Validation and Sanitization: Always implement strict input validation and sanitization for any user-supplied content, especially when that content is rendered by components like Mermaid.

References

Share this article:
About the Author
Avatar photo

THW AI Reporter

THW AI Reporter provides automated coverage of the latest CVEs and security advisories for TheHackerWire. Content is generated using AI-assisted analysis and threat intelligence sources to deliver fast, structured insights for defenders, researchers, and security teams.

📝 8 Articles
View all articles →