CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-23733

Mermaid's Song: From Flowchart to Remote Code Execution in LobeChat

Amit Schendel
Amit Schendel
Senior Security Researcher

Jan 21, 2026·5 min read·35 visits

Executive Summary (TL;DR)

LobeChat trusted user-supplied text when generating Mermaid diagrams. By injecting malicious HTML into a diagram node label, an attacker can trigger XSS. In the Electron app, this XSS exploits a privileged 'runCommand' API to execute system binaries like calc.exe (or worse) on the victim's machine.

A stored Cross-Site Scripting (XSS) vulnerability in LobeChat's Mermaid diagram renderer allows attackers to execute arbitrary JavaScript. In the desktop Electron version, this escalates via an exposed IPC bridge to full Remote Code Execution (RCE).

The Hook: Electron's Glass House

Modern desktop applications are often just web browsers in a trench coat. We call it "Electron," and it's a convenient way to ship cross-platform apps without writing C++. But it comes with a terrifying caveat: if you break the glass wall between the web renderer and the underlying system, you aren't just stealing cookies—you're owning the machine.

LobeChat, a sophisticated open-source AI chat platform, fell into this exact trap. It supports "Artifacts," which are fancy ways to render content generated by LLMs or users. One such artifact type is Mermaid, a JavaScript library that turns text definitions into diagrams.

It sounds innocent enough. You type some syntax, you get a flowchart. But what happens when the renderer blindly trusts the text, and the application blindly trusts the renderer? You get CVE-2026-23733, a bug that turns a flowchart into a command shell.

The Flaw: Trusting the Fish

The vulnerability lies deep within the Renderer component, specifically where it handles content with the MIME type application/lobe.artifacts.mermaid. The code responsible for this was frighteningly simple—too simple.

Here is the logic flaw in its raw glory:

case 'application/lobe.artifacts.mermaid': {
  // "Here, take this raw string and make it a picture."
  return <Mermaid variant={'borderless'}>{content}</Mermaid>;
}

The variable content comes directly from the message payload (user or AI generated). The Mermaid component takes this string and passes it to the underlying Mermaid.js library. The problem? Mermaid.js allows HTML in node labels for styling flexibility. For example, A["<b>Bold</b>"] renders bold text.

But Mermaid doesn't just render bold text; if you pass it A["<img src=x onerror=alert(1)>`"], it renders the image tag and fires the error handler. Because LobeChat failed to sanitize the content before handing it to the diagram engine, it created a classic Stored XSS vector. In a browser, this is bad. In Electron, it's catastrophic.

The Escalation: The Bridge to Nowhere

XSS is the spark, but the fuel for this fire is the Electron IPC (Inter-Process Communication) bridge. LobeChat exposes a global object to the renderer window called electronAPI. This is intended to let the UI talk to the backend (the Main process) to perform tasks like saving files or... running commands.

The application registered a controller named ShellCommandCtr in the main process, which listens for the runCommand event. And look at this beautiful, dangerous function:

@ipcClientEvent('runCommand')
async handleRunCommand({ command, ... }: RunCommandParams) {
  // ... logging logic ...
  // "Execute whatever the renderer asked for."
  const childProcess = spawn(shellConfig.cmd, shellConfig.args, ...);
  // ...
}

This function is a direct wrapper around Node.js's child_process.spawn. It doesn't check who is calling it, only that the call came from the renderer. Since our XSS executes code inside the renderer, it inherits the renderer's permissions. We can simply reach out and touch window.electronAPI, politely asking the main process to nuke the system.

The Exploit: Drawing a Shell

Putting it all together, we don't need a complex binary exploit. We just need a valid Mermaid diagram definition that contains a JavaScript payload. The attack chain looks like this:

  1. Craft the Message: Send a message containing a lobeArtifact tag.
  2. Embed the Payload: Define a Mermaid graph where a node's label contains an <img> tag with an onerror event.
  3. Bypass Quotes: Use String.fromCharCode to construct the payload string to avoid quotation mark escaping hell inside the Mermaid syntax.
  4. Execute: When the victim views the chat, the diagram renders, the image fails to load, and the shell command executes.

Here is the functional Proof of Concept:

<lobeArtifact type="application/lobe.artifacts.mermaid">
```mermaid
graph TD;
 A["&lt;img src=x onerror='window.electronAPI.invoke(\"runCommand\", \{command: \"calc.exe\"\})'&gt;"];
```
</lobeArtifact>
````
 
> [!NOTE]
> In the actual wild exploit, we use `String.fromCharCode` (e.g., `String.fromCharCode(99,97,108,99,46,101,120,101)` for 'calc.exe') to bypass potential strict mode limitations or quote filtering in the Mermaid parser.

The Impact: Game Over

Why should you panic? Because this is a "zero-click" equivalent for the victim once they open the chat. If an attacker can trick an AI into generating this artifact, or if they are in a shared chat environment, the victim's machine is compromised immediately upon rendering the message.

With runCommand access, the attacker can:

  • Exfiltrate Data: Zip up your SSH keys and curl them to a remote server.
  • Persistence: Add a registry run key or a cron job to maintain access after the app closes.
  • Ransomware: Encrypt the user's Documents folder.

The CVSS score of 6.4 feels deceptively low because of the "Local" vector, but in the context of a chat app where users download and run remote content by design, the practical risk is Critical.

The Fix: Sanitizing the Waters

The mitigation is straightforward but essential: Trust No One. The patch implemented in version 2.0.0-next.180 introduces strict sanitization before the content reaches the Mermaid component.

Developers must strip HTML tags from the user input before passing it to libraries that might interpret them. Alternatively, configuring Mermaid's securityLevel to 'strict' can prevent HTML rendering entirely, though this might break some legitimate formatting use cases.

If you are running a self-hosted instance or the local desktop app, update immediately. If you are developing an Electron app, audit every single ipcMain.handle or ipcMain.on listener. If you are exposing a generic spawn or exec wrapper to the renderer, you have built a backdoor; it's just waiting for someone to find the key.

Official Patches

LobeHubRelease notes for version 2.0.0-next.180

Technical Appendix

CVSS Score
6.4/ 10
CVSS:3.1/AV:L/AC:H/PR:H/UI:R/S:C/C:H/I:L/A:L
EPSS Probability
0.08%
Top 77% most exploited

Affected Systems

LobeChat Desktop (Windows)LobeChat Desktop (macOS)LobeChat Desktop (Linux)LobeChat Web (XSS only)

Affected Versions Detail

Product
Affected Versions
Fixed Version
LobeChat
LobeHub
< 2.0.0-next.1802.0.0-next.180
AttributeDetail
CWE IDCWE-94
Attack VectorLocal (via Chat Content)
CVSS Score6.4 (Medium)
EPSS Score0.00078
ImpactRemote Code Execution (RCE)
Exploit StatusPoC Available
PlatformElectron / Node.js

MITRE ATT&CK Mapping

T1189Drive-by Compromise
Initial Access
T1204.002User Execution: Malicious File
Execution
T1059.003Command and Scripting Interpreter: Windows Command Shell
Execution
CWE-94
Code Injection

Improper Control of Generation of Code ('Code Injection')

Known Exploits & Detection

GitHub Security AdvisoryOfficial advisory containing the PoC payload.

Vulnerability Timeline

Vulnerability Published
2026-01-18
Patch Released (v2.0.0-next.180)
2026-01-20

References & Sources

  • [1]GitHub Advisory Database
  • [2]NIST NVD Entry

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•about 1 hour ago•CVE-2024-29203
4.3

CVE-2024-29203: Client-Side Cross-Site Scripting via Unsandboxed Iframes and Legacy Embed Elements in TinyMCE

CVE-2024-29203 identifies a cross-site scripting (XSS) vulnerability in the content ingestion and parsing mechanics of TinyMCE rich text editor. Due to a failure to enforce sandbox attributes on dynamic iframe elements and safely handle legacy embed objects, unauthenticated attackers can inject malicious elements that execute scripts within the context of the parent application session.

Amit Schendel
Amit Schendel
4 views•5 min read
•about 3 hours ago•CVE-2026-9277
8.1

CVE-2026-9277: OS Command Injection in shell-quote via Object-Token Line Terminator Parsing Defect

A technical breakdown of the OS command injection vulnerability in the shell-quote NPM package (CVE-2026-9277 / GHSA-w7jw-789q-3m8p). The bug resides in the character-by-character backslash-escaping logic applied to the .op field of object-tokens within the quote() function, which fails to match and escape line terminators due to a regex matching oversight in JavaScript. This allows unauthenticated remote attackers to execute arbitrary shell commands if they can control inputs processed by this library.

Alon Barad
Alon Barad
7 views•6 min read
•about 4 hours ago•CVE-2026-11645
8.8

CVE-2026-11645: Out-of-Bounds Memory Access in Google Chrome V8 Engine

A high-severity memory corruption vulnerability exists in the V8 JavaScript engine of Google Chrome before versions 149.0.7827.102/103. The flaw arises from an incorrect bounds-check elimination during JIT compilation by the TurboFan optimizer, allowing remote attackers to achieve out-of-bounds read and write access inside the sandboxed renderer process.

Amit Schendel
Amit Schendel
20 views•6 min read
•about 13 hours ago•CVE-2026-50751
9.3

CVE-2026-50751: Authentication Bypass in Check Point Security Gateway IKEv1 Legacy Validation

An improper authentication vulnerability (CWE-287) exists in the legacy, deprecated Internet Key Exchange version 1 (IKEv1) key exchange protocol implementation in Check Point Security Gateways. The vulnerability is caused by a logic flow weakness during the certificate validation process for Remote Access VPN and Mobile Access (SSL VPN) connections. An unauthenticated remote attacker can exploit this weakness to bypass user authentication entirely, establishing a fully functional Remote Access VPN connection without a valid password.

Alon Barad
Alon Barad
64 views•6 min read
•1 day ago•CVE-2026-39922
6.3

CVE-2026-39922: Server-Side Request Forgery in GeoNode Service Registration Endpoint

GeoNode versions prior to 4.4.5 and 5.0.2 are vulnerable to Server-Side Request Forgery (SSRF) in the service registration endpoint. Authenticated attackers with low privileges can exploit insufficient input validation in the Web Map Service (WMS) registration module to force the application server to make outbound network queries to loopback addresses, private RFC1918 subnets, link-local scopes, and cloud metadata endpoints. This technical report details the mechanics of the vulnerability, the underlying architectural flaw, and how to effectively remediate and mitigate the associated security risks.

Alon Barad
Alon Barad
4 views•7 min read
•1 day ago•CVE-2022-0492
7.8

CVE-2022-0492: Privilege Escalation and Container Escape via cgroups v1 release_agent

CVE-2022-0492 is a high-severity missing authorization vulnerability in the Linux kernel's Control Groups (cgroups) v1 implementation. The flaw resides within the cgroup_release_agent_write function in kernel/cgroup/cgroup-v1.c, where the kernel fails to validate if the process writing to the release_agent file possesses administrative capabilities in the initial user namespace. This allows a local attacker inside a container with root privileges (UID 0) to abuse user namespaces, mount a cgroups v1 directory, modify the release_agent parameter, and execute arbitrary commands on the host system as host root, effectively achieving a complete container escape.

Amit Schendel
Amit Schendel
12 views•7 min read