CVE-2025-58768
BaseFortify
Publication date: 2025-09-09
Last updated on: 2025-09-18
Assigner: GitHub, Inc.
Description
Description
CVSS Scores
EPSS Scores
| Probability: | |
| Percentile: |
Meta Information
Affected Vendors & Products
| Vendor | Product | Version / Range |
|---|---|---|
| thinkinai | deepchat | to 0.3.5 (exc) |
Helpful Resources
Exploitability
| CWE ID | Description |
|---|---|
| CWE-79 | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
| CWE-94 | The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. |
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?
CVE-2025-58768 is a critical vulnerability in the Mermaid chart rendering component of DeepChat (versions up to 0.3.4). The issue arises because the component directly assigns user-supplied content to innerHTML without proper sanitization, leading to a persistent cross-site scripting (XSS) vulnerability. This allows attackers to inject malicious JavaScript into Mermaid charts, which can execute arbitrary code on the user's machine via Electron's IPC interface. The exploit can be triggered by user interaction (like clicking) or immediately upon rendering, enabling command execution such as launching system applications. [1]
How can this vulnerability impact me? :
This vulnerability can have severe impacts including remote code execution on the affected system. An attacker can execute arbitrary commands with the privileges of the application, potentially leading to full data compromise, unauthorized data modification, and disruption of system availability. Because the vulnerability allows execution of system commands via Electron IPC, it can be used to run malicious software, steal sensitive information, or disrupt normal operations. [1]
How can this vulnerability be detected on my network or system? Can you suggest some commands?
This vulnerability can be detected by inspecting Mermaid chart content for malicious JavaScript injections, especially looking for suspicious inline JavaScript URIs or image tags with event handlers like 'onerror' embedded in Mermaid syntax. Since the exploit involves Electron IPC calls triggered by rendering or clicking, monitoring Electron IPC invocations for unusual commands such as 'calc.exe' execution attempts can help detect exploitation. Specific commands are not provided in the resources, but reviewing Mermaid chart source code for unsafe 'innerHTML' usage or scanning for suspicious Mermaid nodes with inline JavaScript can be effective. [1]
What immediate steps should I take to mitigate this vulnerability?
The immediate mitigation step is to upgrade DeepChat to version 0.3.5 or later, where the vulnerability has been fixed by properly sanitizing user content before assigning it to 'innerHTML' in the Mermaid chart rendering component. Avoid rendering untrusted Mermaid chart content until the update is applied. Additionally, restrict user input that can be rendered as Mermaid charts and monitor for suspicious IPC calls in Electron. [1]