Description
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') vulnerability in leandrocp MDEx allows stored or reflected cross-site scripting via attacker-controlled Markdown.

When syntax highlighting and full info-string forwarding (render: [full_info_string: true]) are enabled, the Lumis adapter copies the value of a code fence's highlight_lines_class info-string attribute, unescaped, into the class attribute of every rendered line. comrak_nif::lumis_adapter::LumisAdapter::parse_custom_attributes in native/comrak_nif/src/lumis_adapter.rs shlex-parses the info string and stores each key=value pair verbatim, highlight_lines_config pulls highlight_lines_class into the per-line class value, and write_highlighted interpolates that value directly into the class attribute of the per-line <div>. A single-quoted shell token preserves an inner double quote through shlex parsing, so a value such as '"><script>alert(1)</script>' terminates the class attribute early and the markup that follows is emitted as live HTML.

An attacker who can submit Markdown (through comments, posts, wiki pages, documentation, or any user-generated content) can inject arbitrary HTML and JavaScript that runs in the browser of every user who views the rendered output, enabling session theft, account takeover, and other client-side attacks. No authentication or special privileges are required.

The vulnerable native code originally shipped inside mdex (in native/comrak_nif/src/lumis_adapter.rs) and was later extracted into the separate mdex_native package (native/mdex_native_nif/src/lumis_adapter.rs), where it remains unpatched.

This issue affects mdex from 0.11.3 before 0.12.3, and mdex_native from 0.1.0 before 0.2.3.
Published: 2026-06-29
Score: 2.3 Low
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

The vulnerability is an improper neutralization of input during web page generation in leandrocp MDEx, allowing authenticated or unauthenticated users to embed non‑escaped HTML and JavaScript via the highlight_lines_class attribute of a code fence. When full_info_string forwarding is enabled, the value is copied directly into the class attribute of rendered lines, and a specially crafted string such as '"><script>alert(1)</script>' can terminate the class attribute prematurely and inject executable code. This results in stored or reflected cross‑site scripting that runs in the browsers of any user who views the affected Markdown content, enabling session theft, account takeover, and other client‑side attacks.

Affected Systems

Affected products are leandrocp MDEx and its native counterpart MDEx_Native. Versions earlier than 0.12.3 of MDEx and earlier than 0.2.3 of MDEx_Native are vulnerable. The flaw manifests in any context where users can submit Markdown, such as comments, posts, wiki pages, or documentation that is rendered without proper sanitization.

Risk and Exploitability

The CVSS score for this flaw is 2.3, indicating low severity from a vulnerability scoring perspective, and no EPSS or KEV listing is currently available. However, the lack of authentication requirements and the ability to inject arbitrary client‑side code make it an attractive target for attackers seeking account takeover or credential theft. The likely attack vector is a user supplying malicious Markdown content to a public or shared platform that uses MDEx rendering with full_info_string forwarding enabled.

Generated by OpenCVE AI on June 29, 2026 at 20:21 UTC.

Remediation

Vendor Workaround

Do not enable full info-string forwarding (render: [full_info_string: true]) when rendering untrusted Markdown, which prevents the highlight_lines_class attribute from reaching the highlighter. Alternatively, restrict highlight_lines_class values to a safe character set (for example [A-Za-z0-9_- ]) before rendering.


OpenCVE Recommended Actions

  • Upgrade MDEx to 0.12.3 or later and MDEx_Native to 0.2.3 or later.
  • Disable the full_info_string rendering option when processing untrusted Markdown to prevent the highlight_lines_class attribute from being passed to the highlighter.
  • Sanitize or restrict the highlight_lines_class value to a safe alphanumeric set before rendering, ensuring that any embedded quotes are escaped.

Generated by OpenCVE AI on June 29, 2026 at 20:21 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Mon, 29 Jun 2026 20:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Mon, 29 Jun 2026 19:00:00 +0000

Type Values Removed Values Added
Description Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') vulnerability in leandrocp MDEx allows stored or reflected cross-site scripting via attacker-controlled Markdown. When syntax highlighting and full info-string forwarding (render: [full_info_string: true]) are enabled, the Lumis adapter copies the value of a code fence's highlight_lines_class info-string attribute, unescaped, into the class attribute of every rendered line. comrak_nif::lumis_adapter::LumisAdapter::parse_custom_attributes in native/comrak_nif/src/lumis_adapter.rs shlex-parses the info string and stores each key=value pair verbatim, highlight_lines_config pulls highlight_lines_class into the per-line class value, and write_highlighted interpolates that value directly into the class attribute of the per-line <div>. A single-quoted shell token preserves an inner double quote through shlex parsing, so a value such as '"><script>alert(1)</script>' terminates the class attribute early and the markup that follows is emitted as live HTML. An attacker who can submit Markdown (through comments, posts, wiki pages, documentation, or any user-generated content) can inject arbitrary HTML and JavaScript that runs in the browser of every user who views the rendered output, enabling session theft, account takeover, and other client-side attacks. No authentication or special privileges are required. The vulnerable native code originally shipped inside mdex (in native/comrak_nif/src/lumis_adapter.rs) and was later extracted into the separate mdex_native package (native/mdex_native_nif/src/lumis_adapter.rs), where it remains unpatched. This issue affects mdex from 0.11.3 before 0.12.3, and mdex_native from 0.1.0 before 0.2.3.
Title Cross-site scripting in MDEx via unescaped highlight_lines_class code-fence attribute
First Time appeared Leandrocp
Leandrocp mdex
Leandrocp mdex Native
Weaknesses CWE-79
CPEs cpe:2.3:a:leandrocp:mdex:*:*:*:*:*:*:*:*
cpe:2.3:a:leandrocp:mdex_native:*:*:*:*:*:*:*:*
Vendors & Products Leandrocp
Leandrocp mdex
Leandrocp mdex Native
References
Metrics cvssV4_0

{'score': 2.3, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N'}


Subscriptions

Leandrocp Mdex Mdex Native
cve-icon MITRE

Status: PUBLISHED

Assigner: EEF

Published:

Updated: 2026-06-30T04:37:51.902Z

Reserved: 2026-06-09T11:01:47.529Z

Link: CVE-2026-53427

cve-icon Vulnrichment

Updated: 2026-06-29T19:19:09.581Z

cve-icon NVD

No data.

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-06-30T05:30:08Z

Weaknesses
  • CWE-79

    Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')