{"id":"CVE-2026-53427","aliases":["CVE-2026-53427","EEF-CVE-2026-53427","GHSA-v664-pmxr-mxxx"],"related":[],"kind":"vulnerability","state":"published","title":"Cross-site scripting in MDEx via unescaped highlight_lines_class code-fence attribute","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.\n\nWhen 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.\n\nAn 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.\n\nThe 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).\n\nThis issue affects mdex: from 0.8.0 before 0.12.3; mdex_native: from 0.1.0 before 0.2.3.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.\n\nWhen 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.\n\nAn 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.\n\nThe 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).\n\nThis issue affects mdex: from 0.8.0 before 0.12.3; mdex_native: from 0.1.0 before 0.2.3.","source":"cvelist"},{"lang":"en","text":"## Summary\n\nImproper 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.\n\nWhen 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.\n\nAn 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.\n\nThe 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`).\n\nThis issue affects mdex: from 0.8.0 before 0.12.3; mdex_native: from 0.1.0 before 0.2.3.\n\n## Workarounds\n\nDo 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.\n\n## Configurations\n\nThe 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.","format":"markdown","source":"eef"},{"lang":"es","text":"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.\n\nCuando 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.\n\nUn 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.\n\nEl 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.\n\nEste 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.","source":"nvd"}],"published":"2026-06-29T18:50:17.185Z","modified":"2026-11-25T17:23:09.546Z","severity":{"scorer":"EEF","scheme":"CVSS:4.0","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","score":2.3,"rating":"LOW"},"severities":[{"scorer":"EEF","scheme":"CVSS:4.0","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","score":2.3,"rating":"LOW"},{"scorer":"Erlang Ecosystem Foundation","scheme":"CVSS:4.0","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"}],"cwes":["CWE-79"],"affected":[{"ranges":[{"type":"semver","introduced":"0.8.0","fixed":"0.12.3","status":"affected"}],"vendor":"leandrocp","product":"mdex","package":"mdex","cpe":"cpe:2.3:a:leandrocp:mdex:*:*:*:*:*:*:*:*","repo":"https://github.com/leandrocp/mdex","source":"cvelist"},{"ranges":[{"type":"git","introduced":"0107e1d55b7679677a82745911b4139c96307264","fixed":"6ed94d905f97af188323f042698ae841c02293b4","status":"affected"}],"vendor":"leandrocp","product":"mdex","package":"leandrocp/mdex","cpe":"cpe:2.3:a:leandrocp:mdex:*:*:*:*:*:*:*:*","repo":"https://github.com/leandrocp/mdex","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0.1.0","fixed":"0.2.3","status":"affected"}],"vendor":"leandrocp","product":"mdex_native","package":"mdex_native","cpe":"cpe:2.3:a:leandrocp:mdex_native:*:*:*:*:*:*:*:*","repo":"https://github.com/leandrocp/mdex_native","source":"cvelist"},{"ranges":[{"type":"git","introduced":"956528c5e31746253347029e810a969ab916fd27","fixed":"7738ff428a54058ea0a3293eb2e17b5f4c953e2d","status":"affected"}],"vendor":"leandrocp","product":"mdex_native","package":"leandrocp/mdex_native","cpe":"cpe:2.3:a:leandrocp:mdex_native:*:*:*:*:*:*:*:*","repo":"https://github.com/leandrocp/mdex_native","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0.8.0","status":"affected","fixed":"0.12.3"}],"ecosystem":"Hex","package":"mdex","purl":"pkg:hex/mdex","source":"eef"},{"ranges":[{"type":"semver","introduced":"0.1.0","status":"affected","fixed":"0.2.3"}],"ecosystem":"Hex","package":"mdex_native","purl":"pkg:hex/mdex_native","source":"eef"},{"ranges":[{"type":"git","introduced":"0107e1d55b7679677a82745911b4139c96307264","status":"affected","fixed":"6ed94d905f97af188323f042698ae841c02293b4"}],"repo":"https://github.com/leandrocp/mdex","source":"eef"},{"ranges":[{"type":"git","introduced":"956528c5e31746253347029e810a969ab916fd27","status":"affected","fixed":"7738ff428a54058ea0a3293eb2e17b5f4c953e2d"}],"repo":"https://github.com/leandrocp/mdex_native","source":"eef"}],"references":[{"url":"https://github.com/leandrocp/mdex_native/security/advisories/GHSA-v664-pmxr-mxxx","tags":["advisory","related","vendor-advisory"],"sources":["cvelist","eef","nvd"]},{"url":"https://cna.erlef.org/cves/CVE-2026-53427.html","tags":["related","web"],"sources":["cvelist","eef","nvd"]},{"url":"https://osv.dev/vulnerability/EEF-CVE-2026-53427","tags":["related"],"sources":["cvelist","nvd"]},{"url":"https://github.com/leandrocp/mdex/commit/0107e1d55b7679677a82745911b4139c96307264","tags":["related","web"],"sources":["cvelist","eef","nvd"]},{"url":"https://github.com/leandrocp/mdex/commit/6ed94d905f97af188323f042698ae841c02293b4","tags":["fix","patch"],"sources":["cvelist","eef","nvd"]},{"url":"https://github.com/leandrocp/mdex_native/commit/956528c5e31746253347029e810a969ab916fd27","tags":["related","web"],"sources":["cvelist","eef","nvd"]},{"url":"https://github.com/leandrocp/mdex_native/commit/7738ff428a54058ea0a3293eb2e17b5f4c953e2d","tags":["fix","patch"],"sources":["cvelist","eef","nvd"]},{"url":"https://hex.pm/packages/mdex","tags":["package"],"sources":["eef"]},{"url":"https://hex.pm/packages/mdex_native","tags":["package"],"sources":["eef"]}],"credits":["Peter Ullrich","Jonatan Männchen / EEF","Leandro Pereira"],"assigner":"EEF","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-06-29T19:18:13.166Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-53427","url":"https://www.cve.org/CVERecord?id=CVE-2026-53427","licence":"CVE Terms of Use","modified":"2026-11-20T08:58:27.078Z"},{"source":"eef","name":"Erlang Ecosystem Foundation","id":"EEF-CVE-2026-53427","url":"https://osv.dev/vulnerability/EEF-CVE-2026-53427","licence":"CC-BY-4.0","modified":"2026-11-25T17:23:09.546Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-53427","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-53427","licence":"Public domain","modified":"2026-11-20T09:20:13.647Z"}],"updatedAt":"2026-11-25T22:59:26.638Z","epss":{"score":0.00451,"percentile":0.409,"date":"2026-12-01T12:00:22.000Z"}}