2.3low
Cross-site scripting in MDEx via unescaped highlight_lines_class code-fence attribute
- Severity
- 2.3low CVSS:4.0 by EEF
- Exploit likelihood
- 0.45% (higher than 40% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- EEF
- Also known as
- EEF-CVE-2026-53427GHSA-v664-pmxr-mxxx
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/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.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| mdex | from 0.8.0 before 0.12.3 | CVE List |
| leandrocp/mdex | from 0107e1d55b7679677a82745911b4139c96307264 before 6ed94d905f97af188323f042698ae841c02293b4 | CVE List |
| mdex_native | from 0.1.0 before 0.2.3 | CVE List |
| leandrocp/mdex_native | from 956528c5e31746253347029e810a969ab916fd27 before 7738ff428a54058ea0a3293eb2e17b5f4c953e2d | CVE List |
| mdex (Hex) | from 0.8.0 before 0.12.3 | Erlang Ecosystem Foundation |
| mdex_native (Hex) | from 0.1.0 before 0.2.3 | Erlang Ecosystem Foundation |
| https://github.com/leandrocp/mdex | from 0107e1d55b7679677a82745911b4139c96307264 before 6ed94d905f97af188323f042698ae841c02293b4 | Erlang Ecosystem Foundation |
| https://github.com/leandrocp/mdex_native | from 956528c5e31746253347029e810a969ab916fd27 before 7738ff428a54058ea0a3293eb2e17b5f4c953e2d | Erlang Ecosystem Foundation |
All scores
| EEF | 2.3low CVSS:4.0 | 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 |
| Erlang Ecosystem Foundation | Not scored CVSS:4.0 | 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 |
Classification
SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.
What each source says
CVE List
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.
Erlang Ecosystem Foundation
Summary
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.
Workarounds
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.
Configurations
The vulnerable code path is only reachable when MDEx is configured with a syntax-highlighting formatter (for example syntax_highlight: [formatter: {:html_inline, ...}] or {:html_linked, ...}) and with full info-string forwarding enabled (render: [full_info_string: true]). Full info-string forwarding is required for comrak to hand the highlight_lines_class attribute to the highlighter, so any application that uses the line-highlighting attributes already has it enabled.
NVD (es)
Neutralización Incorrecta de Entrada Durante la Generación de Páginas Web (’Cross-site Scripting’) vulnerabilidad en leandrocp MDEx permite cross-site scripting almacenado o reflejado a través de Markdown controlado por el atacante. Cuando el resaltado de sintaxis y el reenvío completo de cadenas de información (render: [full_info_string: true]) están habilitados, el adaptador Lumis copia el valor del atributo de cadena de información highlight_lines_class de una valla de código, sin escapar, en el atributo de clase de cada línea renderizada. comrak_nif::lumis_adapter::LumisAdapter::parse_custom_attributes en native/comrak_nif/src/lumis_adapter.rs analiza con shlex la cadena de información y almacena cada par clave=valor textualmente, highlight_lines_config extrae highlight_lines_class al valor de clase por línea, y write_highlighted interpola ese valor directamente en el atributo de clase del [div] por línea. Un token de shell entre comillas simples preserva una comilla doble interna a través del análisis shlex, por lo que un valor como ’”>[script_tag]alert(1)[/script]’ termina el atributo de clase prematuramente y el marcado que sigue se emite como HTML en vivo. Un atacante que puede enviar Markdown (a través de comentarios, publicaciones, páginas wiki, documentación o cualquier contenido generado por el usuario) puede inyectar HTML y JavaScript arbitrarios que se ejecutan en el navegador de cada usuario que ve la salida renderizada, lo que permite el robo de sesión, la toma de control de cuentas y otros ataques del lado del cliente. No se requiere autenticación ni privilegios especiales. El código nativo vulnerable se envió originalmente dentro de mdex (en native/comrak_nif/src/lumis_adapter.rs) y luego se extrajo en el paquete mdex_native separado (native/mdex_native_nif/src/lumis_adapter.rs), donde permanece sin parchear. Este problema afecta a mdex desde 0.11.3 antes de 0.12.3, y a mdex_native desde 0.1.0 antes de 0.2.3.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-53427 changed 2026-11-20 | CVE Terms of Use |
| Erlang Ecosystem Foundation | EEF-CVE-2026-53427 changed 2026-11-25 | CC-BY-4.0 |
| NVD | CVE-2026-53427 changed 2026-11-20 | Public domain |