Cross-site scripting in MDEx via unescaped highlight_lines_class code-fence attribute
CVE-2026-53427Published 29 Jun 2026, 18:50 UTC
Real-world risk
0.8/ 10Low
Routine
If the vulnerable configuration applies to you: 1.8
PreliminaryFrom the CVSS vector only · confidence low
CVSS
2.3
scored by the vendor (CNA), CVSS 4.0
In plain words
No plain-language summary yet. The original description is below.
Original description (from EEF)
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/autumnus_adapter.rs, later renamed to 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). This issue affects mdex: from 0.8.0 before 0.12.3; mdex_native: from 0.1.0 before 0.2.3.
Am I affected?
| Product | Affected versions (from the sources) | Fixed in |
|---|---|---|
| mdexNiche | >= 0.8.0, < 0.12.3; >= 0.1.0, < 0.2.3 | 0.12.3, 0.2.3 |
What to do
Update to a fixed version: 0.12.3, 0.2.3.
Why this score
| Factor | Value | Evidence | × |
|---|---|---|---|
| Impact | MinorReflected XSS, CSRF with low effect, open redirect, minor leak | From the CVSS vector | 0.30 |
| Attacker position | InternetAnyone on the Internet can reach a typical deployment | From the CVSS vector | 1.00 |
| Privileges needed | NoneNo account | From the CVSS vector | 1.00 |
| Victim interaction | RoutineA normal action: open a file, visit a page, click a link | From the CVSS vector | 0.70 |
| Configuration | UncommonNeeds a non-default feature that a minority enables | From the CVSS vector | 0.45 |
| Reliability | ReliableDeterministic: injection, logic bug, path traversal | From the CVSS vector | 1.00 |
Threat level T1: Nothing known (× 0.85)
The default for a new disclosure
EPSS 0.5% chance of exploitation in 30 days (percentile 41), as of 2026-12-02.
The arithmetic
- Prerequisites multiplied together0.315
- Threat T1: Nothing known0.850
- 10 × impact 0.3 × prerequisites 0.315 × threat 0.850.803
- Rounded to one decimal between 0.1 and 100.8
Exploitation and evidence timeline
- 29 Jun 2026 Published
- 2 Dec 2026 Risk 0.8 (cvss fallback)
Weakness
CWE-79
References
- https://github.com/leandrocp/mdex_native/security/advisories/GHSA-v664-pmxr-mxxxrelated, vendor-advisory
- https://cna.erlef.org/cves/CVE-2026-53427.htmlrelated
- https://osv.dev/vulnerability/EEF-CVE-2026-53427related
- https://github.com/leandrocp/mdex/commit/0107e1d55b7679677a82745911b4139c96307264related
- https://github.com/leandrocp/mdex/commit/6ed94d905f97af188323f042698ae841c02293b4patch
- https://github.com/leandrocp/mdex_native/commit/956528c5e31746253347029e810a969ab916fd27related
- https://github.com/leandrocp/mdex_native/commit/7738ff428a54058ea0a3293eb2e17b5f4c953e2dpatch
- CVE-2026-53427 on CVE.org