/

CVE-2026-22793

Severity:

CRITICAL RISK

(9.6)

Code Injection in 5ire ECharts Markdown Plugin

CVE-2026-22793

Analyzed

Vulnerability type

Category:

Code Injection

CWE:

CWE-94

Impact:

Remote Code Execution via Arbitrary JavaScript in Renderer Context

Severity:

CRITICAL RISK

(9.6)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

An unsafe option parsing flaw in 5ire's ECharts Markdown plugin allows arbitrary JavaScript execution within the renderer context whenever untrusted ECharts code blocks are processed.

In environments where privileged APIs (such as Electron's electron.mcp) are exposed, this JavaScript execution can escalate to full remote code execution on the host system for any user able to submit or influence ECharts code blocks.

Affected context

The vulnerability arises when 5ire is configured to render Markdown content that includes ECharts code blocks, and the ECharts Markdown plugin parses options from this content in an unsafe manner.

It becomes particularly dangerous in desktop environments using Electron or similar frameworks where the renderer has access to privileged APIs (for example, through electron.mcp or other bridge mechanisms).

Any scenario where untrusted or user-supplied Markdown—including ECharts snippets—can be rendered inside 5ire may be affected, especially if the renderer is not strictly sandboxed.

Exploit preconditions

  • Attack surface: Markdown/ECharts rendering pipeline within the 5ire desktop application.
  • Required access: Ability to submit, edit, or otherwise influence ECharts code blocks in Markdown content rendered by 5ire (e.g., chat messages, notes, shared documents, or synced files).
  • Trigger point: Rendering of a malicious ECharts code block by the vulnerable ECharts Markdown plugin, which unsafely parses and evaluates options.
  • Why exploitation is possible: The option parsing logic treats attacker-controlled ECharts options as executable JavaScript or passes them into dynamically evaluated constructs, enabling arbitrary code execution in the renderer context. In Electron-like environments with exposed privileged APIs, this JavaScript can interact with the host to achieve full RCE.

Why this happens

The core issue is an unsafe interpretation of user-controlled configuration data as executable code, aligning with CWE-94: Improper Control of Generation of Code ('Code Injection').

Within the ECharts Markdown plugin, options extracted from code blocks are not constrained to a data-only representation; instead, they are processed in a way that allows JavaScript expressions or functions to be evaluated in the renderer environment.

This pattern effectively merges data (chart options) and code (execution context) without enforcing a strict separation or sanitization layer, enabling attackers to inject arbitrary JavaScript wherever they can provide ECharts configuration content.

Potential impact

  • Execution of arbitrary JavaScript within the renderer context of the 5ire desktop application.
  • Remote Code Execution on the host system when privileged Electron APIs (such as electron.mcp) or similar bridges are accessible from the renderer.
  • Full compromise of the affected user's workstation, including reading and modifying local files where the application has access.
  • Theft of authentication tokens, session cookies, or API keys accessible to the application.
  • Lateral movement by using the compromised host to attack other systems or services reachable from that environment.

General mitigation guidance

Effective mitigation focuses on separating untrusted data from executable code and minimizing renderer privileges:

  • Treat ECharts options strictly as data structures (e.g., JSON-only), avoiding support for embedded JavaScript functions, expressions, or dynamic evaluation in user-supplied content.
  • Introduce a robust validation layer for all chart options parsed from Markdown, rejecting or stripping constructs that could cause code execution or reference dynamic global objects.
  • Apply a strict sandbox model for renderer processes, ensuring they have no direct access to host-level APIs and can only interact through carefully designed, permission-checked IPC channels.
  • Reduce the exposure of powerful APIs (such as electron.mcp and similar bridges) to the renderer; where they must exist, gate them behind explicit permission checks and origin/context validation.
  • Adopt a "safe-by-default" Markdown and plugin configuration that disables rich scripting features in rendered content unless explicitly needed and vetted.

How teams detect issues like this

Detection can rely on both code-centric analysis and runtime monitoring:

  • Static analysis and code review:
  • Search for dynamic code execution patterns in Markdown plugins and rendering logic (e.g., eval, new Function, vm usage, or dynamic require/import based on user data).
  • Flag any pathways where ECharts options or Markdown content can flow into executable contexts or privileged IPC calls.
  • Enforce secure coding guidelines around Electron preload scripts and bridge APIs, reviewing for unnecessary exposure to the renderer.
  • Policy and configuration checks:
  • Validate that renderer processes are sandboxed and that nodeIntegration, remote modules, or equivalent high-risk features are disabled unless absolutely necessary.
  • Maintain a rule set in automated code review tools (SAST, linters) to detect unsafe plugin patterns across Markdown and visualization components.
  • Runtime and behavioral monitoring:
  • Instrument the application to log and alert on unexpected invocations of privileged APIs from renderer contexts, particularly those originating from content rendering flows.
  • Use application-level security monitoring to detect anomalies such as unexpected file access, command execution, or network calls initiated during Markdown/ECharts rendering.

Sources

SourceLink
github.comgithub.com/nanbingxyz/5ire/releases/tag/v0.15.3
github.comgithub.com/nanbingxyz/5ire/security/advisories/GHSA-wg3x-7c26-97wj

Frequently asked

questions

Yes, in contexts where an attacker can cause 5ire to render untrusted Markdown containing ECharts code blocks—for example, via shared documents, synchronized notes, or other collaborative inputs. The exploit executes in the renderer context and may escalate to full RCE if privileged APIs are exposed.

An attacker must be able to submit or influence ECharts code blocks that 5ire will render. This could be through direct user input (if the user is tricked into pasting or importing malicious content) or through any integration that feeds Markdown/ECharts content into the application.

The most robust fix is to treat all chart configuration as pure data: remove or disable support for executable JavaScript in ECharts options sourced from untrusted content, enforce strict schema validation, and refactor any dynamic evaluation mechanisms into data-only parsing. Additionally, restrict renderer privileges so that even if JavaScript runs, it cannot directly compromise the host.

Establish a security design principle that untrusted content—Markdown, charts, templates—must never be treated as code. Use safe parsing libraries, prohibit dynamic evaluation in rendering pipelines, and apply a hardened Electron (or equivalent) configuration with sandboxed renderers and minimal exposed APIs. Incorporate automated security checks into CI to flag dangerous patterns like eval or unvetted bridges from content to host capabilities.

Find out what's already
exploitable in your codebase.