CVE-2026-53427Cross-site scripting in MDEx via unescaped highlight_lines_class code-fence attribute
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.
What to do
None of the Linux distributions or Windows releases we track list an affected package for this CVE. Check the vendor-reported products below.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
What the vendor says
As published in the CVE record by EEF, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- leandrocp mdex: affected: 0.8.0 to before 0.12.3; fixed in
0.12.3 - leandrocp mdex: affected: 0107e1d55b7679677a82745911b4139c96307264 to before 6ed94d905f97af188323f042698ae841c02293b4; fixed in
6ed94d905f97af188323f042698ae841c02293b4 - leandrocp mdex_native: affected: 0.1.0 to before 0.2.3; fixed in
0.2.3 - leandrocp mdex_native: affected: 956528c5e31746253347029e810a969ab916fd27 to before 7738ff428a54058ea0a3293eb2e17b5f4c953e2d; fixed in
7738ff428a54058ea0a3293eb2e17b5f4c953e2d
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.
Vendor advisories:
- https://github.com/leandrocp/mdex_native/security/advisories/GHSA-v664-pmxr-mxxx (vendor-advisory)
- https://github.com/leandrocp/mdex/commit/6ed94d905f97af188323f042698ae841c02293b4 (patch)
- https://github.com/leandrocp/mdex_native/commit/7738ff428a54058ea0a3293eb2e17b5f4c953e2d (patch)
References
- https://github.com/leandrocp/mdex_native/security/advisories/GHSA-v664-pmxr-mxxx
- https://cna.erlef.org/cves/CVE-2026-53427.html
- https://osv.dev/vulnerability/EEF-CVE-2026-53427
- https://github.com/leandrocp/mdex/commit/0107e1d55b7679677a82745911b4139c96307264
- https://github.com/leandrocp/mdex/commit/6ed94d905f97af188323f042698ae841c02293b4
- https://github.com/leandrocp/mdex_native/commit/956528c5e31746253347029e810a969ab916fd27
- https://github.com/leandrocp/mdex_native/commit/7738ff428a54058ea0a3293eb2e17b5f4c953e2d
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.