{"id":"CVE-2026-53427","state":"PUBLISHED","title":"Cross-site scripting in MDEx via unescaped highlight_lines_class code-fence attribute","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.\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/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.\n\nThis issue affects mdex from 0.11.3 before 0.12.3, and mdex_native from 0.1.0 before 0.2.3.","publishedAt":"2026-06-29T18:50:17.185Z","updatedAt":"2026-06-30T04:37:51.902Z","severity":{"score":2.3,"label":"Low","version":"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","source":"EEF"},"assigner":"EEF","products":["leandrocp mdex","leandrocp mdex_native"],"affected":[{"vendor":"leandrocp","product":"mdex","packageName":"mdex","packageURL":"pkg:hex/mdex","defaultStatus":"unaffected","versions":[{"version":"0.11.3","status":"affected","lessThan":"0.12.3","versionType":"semver"}],"collectionURL":"https://repo.hex.pm","cpes":["cpe:2.3:a:leandrocp:mdex:*:*:*:*:*:*:*:*"],"modules":["'Elixir.MDEx'","comrak_nif"],"programFiles":["native/comrak_nif/src/lumis_adapter.rs"],"programRoutines":[{"name":"comrak_nif::lumis_adapter::LumisAdapter::parse_custom_attributes"},{"name":"comrak_nif::lumis_adapter::LumisAdapter::highlight_lines_config"},{"name":"comrak_nif::lumis_adapter::LumisAdapter::write_highlighted"},{"name":"'Elixir.MDEx':to_html/2"}],"repo":"https://github.com/leandrocp/mdex"},{"vendor":"leandrocp","product":"mdex","packageName":"leandrocp/mdex","packageURL":"pkg:github/leandrocp/mdex","defaultStatus":"unaffected","versions":[{"version":"0d7ffc84ea742e1daf666426814e5bb6d0499433","status":"affected","lessThan":"6ed94d905f97af188323f042698ae841c02293b4","versionType":"git"}],"collectionURL":"https://github.com","cpes":["cpe:2.3:a:leandrocp:mdex:*:*:*:*:*:*:*:*"],"modules":["'Elixir.MDEx'","comrak_nif"],"programFiles":["native/comrak_nif/src/lumis_adapter.rs"],"programRoutines":[{"name":"comrak_nif::lumis_adapter::LumisAdapter::parse_custom_attributes"},{"name":"comrak_nif::lumis_adapter::LumisAdapter::highlight_lines_config"},{"name":"comrak_nif::lumis_adapter::LumisAdapter::write_highlighted"},{"name":"'Elixir.MDEx':to_html/2"}],"repo":"https://github.com/leandrocp/mdex"},{"vendor":"leandrocp","product":"mdex_native","packageName":"mdex_native","packageURL":"pkg:hex/mdex_native","defaultStatus":"unaffected","versions":[{"version":"0.1.0","status":"affected","lessThan":"0.2.3","versionType":"semver"}],"collectionURL":"https://repo.hex.pm","cpes":["cpe:2.3:a:leandrocp:mdex_native:*:*:*:*:*:*:*:*"],"modules":["'Elixir.MDExNative.Comrak'","mdex_native_nif"],"programFiles":["native/mdex_native_nif/src/lumis_adapter.rs"],"programRoutines":[{"name":"mdex_native_nif::lumis_adapter::LumisAdapter::parse_custom_attributes"},{"name":"mdex_native_nif::lumis_adapter::LumisAdapter::highlight_lines_config"},{"name":"mdex_native_nif::lumis_adapter::LumisAdapter::write_highlighted"},{"name":"'Elixir.MDExNative.Native':document_to_html_with_options/2"},{"name":"'Elixir.MDExNative.Comrak':document_to_html/2"}],"repo":"https://github.com/leandrocp/mdex_native"},{"vendor":"leandrocp","product":"mdex_native","packageName":"leandrocp/mdex_native","packageURL":"pkg:github/leandrocp/mdex_native","defaultStatus":"unaffected","versions":[{"version":"956528c5e31746253347029e810a969ab916fd27","status":"affected","lessThan":"798a363b4339f6f7162ec8437c4c9f9b5ae6fbf3","versionType":"git"}],"collectionURL":"https://github.com","cpes":["cpe:2.3:a:leandrocp:mdex_native:*:*:*:*:*:*:*:*"],"modules":["'Elixir.MDExNative.Comrak'","mdex_native_nif"],"programFiles":["native/mdex_native_nif/src/lumis_adapter.rs"],"programRoutines":[{"name":"mdex_native_nif::lumis_adapter::LumisAdapter::parse_custom_attributes"},{"name":"mdex_native_nif::lumis_adapter::LumisAdapter::highlight_lines_config"},{"name":"mdex_native_nif::lumis_adapter::LumisAdapter::write_highlighted"},{"name":"'Elixir.MDExNative.Native':document_to_html_with_options/2"},{"name":"'Elixir.MDExNative.Comrak':document_to_html/2"}],"repo":"https://github.com/leandrocp/mdex_native"}],"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"],"weaknesses":["CWE-79"],"ingestedAt":"2026-10-29T20:12:16.098Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/53xxx/CVE-2026-53427.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-53427","state":"PUBLISHED","datePublished":"2026-06-29T18:50:17.185Z","dateUpdated":"2026-06-30T04:37:51.902Z","assignerShortName":"EEF","assignerOrgId":"6b3ad84c-e1a6-4bf7-a703-f496b71e49db","dateReserved":"2026-06-09T11:01:47.529Z"},"containers":{"cna":{"title":"Cross-site scripting in MDEx via unescaped highlight_lines_class code-fence attribute","descriptions":[{"lang":"en","value":"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/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.\n\nThis issue affects mdex from 0.11.3 before 0.12.3, and mdex_native from 0.1.0 before 0.2.3."}],"affected":[{"vendor":"leandrocp","product":"mdex","packageName":"mdex","packageURL":"pkg:hex/mdex","defaultStatus":"unaffected","versions":[{"version":"0.11.3","status":"affected","lessThan":"0.12.3","versionType":"semver"}],"collectionURL":"https://repo.hex.pm","cpes":["cpe:2.3:a:leandrocp:mdex:*:*:*:*:*:*:*:*"],"modules":["'Elixir.MDEx'","comrak_nif"],"programFiles":["native/comrak_nif/src/lumis_adapter.rs"],"programRoutines":[{"name":"comrak_nif::lumis_adapter::LumisAdapter::parse_custom_attributes"},{"name":"comrak_nif::lumis_adapter::LumisAdapter::highlight_lines_config"},{"name":"comrak_nif::lumis_adapter::LumisAdapter::write_highlighted"},{"name":"'Elixir.MDEx':to_html/2"}],"repo":"https://github.com/leandrocp/mdex"},{"vendor":"leandrocp","product":"mdex","packageName":"leandrocp/mdex","packageURL":"pkg:github/leandrocp/mdex","defaultStatus":"unaffected","versions":[{"version":"0d7ffc84ea742e1daf666426814e5bb6d0499433","status":"affected","lessThan":"6ed94d905f97af188323f042698ae841c02293b4","versionType":"git"}],"collectionURL":"https://github.com","cpes":["cpe:2.3:a:leandrocp:mdex:*:*:*:*:*:*:*:*"],"modules":["'Elixir.MDEx'","comrak_nif"],"programFiles":["native/comrak_nif/src/lumis_adapter.rs"],"programRoutines":[{"name":"comrak_nif::lumis_adapter::LumisAdapter::parse_custom_attributes"},{"name":"comrak_nif::lumis_adapter::LumisAdapter::highlight_lines_config"},{"name":"comrak_nif::lumis_adapter::LumisAdapter::write_highlighted"},{"name":"'Elixir.MDEx':to_html/2"}],"repo":"https://github.com/leandrocp/mdex"},{"vendor":"leandrocp","product":"mdex_native","packageName":"mdex_native","packageURL":"pkg:hex/mdex_native","defaultStatus":"unaffected","versions":[{"version":"0.1.0","status":"affected","lessThan":"0.2.3","versionType":"semver"}],"collectionURL":"https://repo.hex.pm","cpes":["cpe:2.3:a:leandrocp:mdex_native:*:*:*:*:*:*:*:*"],"modules":["'Elixir.MDExNative.Comrak'","mdex_native_nif"],"programFiles":["native/mdex_native_nif/src/lumis_adapter.rs"],"programRoutines":[{"name":"mdex_native_nif::lumis_adapter::LumisAdapter::parse_custom_attributes"},{"name":"mdex_native_nif::lumis_adapter::LumisAdapter::highlight_lines_config"},{"name":"mdex_native_nif::lumis_adapter::LumisAdapter::write_highlighted"},{"name":"'Elixir.MDExNative.Native':document_to_html_with_options/2"},{"name":"'Elixir.MDExNative.Comrak':document_to_html/2"}],"repo":"https://github.com/leandrocp/mdex_native"},{"vendor":"leandrocp","product":"mdex_native","packageName":"leandrocp/mdex_native","packageURL":"pkg:github/leandrocp/mdex_native","defaultStatus":"unaffected","versions":[{"version":"956528c5e31746253347029e810a969ab916fd27","status":"affected","lessThan":"798a363b4339f6f7162ec8437c4c9f9b5ae6fbf3","versionType":"git"}],"collectionURL":"https://github.com","cpes":["cpe:2.3:a:leandrocp:mdex_native:*:*:*:*:*:*:*:*"],"modules":["'Elixir.MDExNative.Comrak'","mdex_native_nif"],"programFiles":["native/mdex_native_nif/src/lumis_adapter.rs"],"programRoutines":[{"name":"mdex_native_nif::lumis_adapter::LumisAdapter::parse_custom_attributes"},{"name":"mdex_native_nif::lumis_adapter::LumisAdapter::highlight_lines_config"},{"name":"mdex_native_nif::lumis_adapter::LumisAdapter::write_highlighted"},{"name":"'Elixir.MDExNative.Native':document_to_html_with_options/2"},{"name":"'Elixir.MDExNative.Comrak':document_to_html/2"}],"repo":"https://github.com/leandrocp/mdex_native"}],"references":[{"url":"https://github.com/leandrocp/mdex_native/security/advisories/GHSA-v664-pmxr-mxxx","tags":["vendor-advisory","related"]},{"url":"https://cna.erlef.org/cves/CVE-2026-53427.html","tags":["related"]},{"url":"https://osv.dev/vulnerability/EEF-CVE-2026-53427","tags":["related"]},{"url":"https://github.com/leandrocp/mdex_native/commit/798a363b4339f6f7162ec8437c4c9f9b5ae6fbf3","tags":["patch"]}],"metrics":[{"cvssV4_0":{"attackComplexity":"LOW","attackRequirements":"PRESENT","attackVector":"NETWORK","baseScore":2.3,"baseSeverity":"LOW","privilegesRequired":"NONE","subAvailabilityImpact":"NONE","subConfidentialityImpact":"LOW","subIntegrityImpact":"LOW","userInteraction":"PASSIVE","vectorString":"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","version":"4.0","vulnAvailabilityImpact":"NONE","vulnConfidentialityImpact":"NONE","vulnIntegrityImpact":"NONE"},"format":"CVSS","scenarios":[{"lang":"en","value":"GENERAL"}]}],"problemTypes":[{"descriptions":[{"cweId":"CWE-79","description":"CWE-79 Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')","lang":"en","type":"CWE"}]}],"providerMetadata":{"shortName":"EEF","orgId":"6b3ad84c-e1a6-4bf7-a703-f496b71e49db","dateUpdated":"2026-06-30T04:37:51.902Z"},"configurations":[{"lang":"en","supportingMedia":[{"base64":false,"type":"text/html","value":"<p>The vulnerable code path is only reachable when MDEx is configured with a syntax-highlighting formatter (for example <tt>syntax_highlight: [formatter: {:html_inline, ...}]</tt> or <tt>{:html_linked, ...}</tt>) and with full info-string forwarding enabled (<tt>render: [full_info_string: true]</tt>). Full info-string forwarding is required for comrak to hand the <tt>highlight_lines_class</tt> attribute to the highlighter, so any application that uses the line-highlighting attributes already has it enabled.</p>"}],"value":"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."}],"cpeApplicability":[{"nodes":[{"cpeMatch":[{"criteria":"cpe:2.3:a:leandrocp:mdex:*:*:*:*:*:*:*:*","versionEndExcluding":"0.12.3","versionStartIncluding":"0.11.3","vulnerable":true}],"negate":false,"operator":"AND"},{"cpeMatch":[{"criteria":"cpe:2.3:a:leandrocp:mdex_native:*:*:*:*:*:*:*:*","versionEndExcluding":"0.2.3","versionStartIncluding":"0.1.0","vulnerable":true}],"negate":false,"operator":"AND"}],"operator":"OR"}],"credits":[{"lang":"en","type":"finder","value":"Peter Ullrich"},{"lang":"en","type":"remediation developer","value":"Leandro Pereira"},{"lang":"en","type":"analyst","value":"Jonatan Männchen / EEF"}],"impacts":[{"capecId":"CAPEC-63","descriptions":[{"lang":"en","value":"CAPEC-63 Cross-Site Scripting (XSS)"}]}],"source":{"discovery":"EXTERNAL"},"workarounds":[{"lang":"en","supportingMedia":[{"base64":false,"type":"text/html","value":"<p>Do not enable full info-string forwarding (<tt>render: [full_info_string: true]</tt>) when rendering untrusted Markdown, which prevents the <tt>highlight_lines_class</tt> attribute from reaching the highlighter. Alternatively, restrict <tt>highlight_lines_class</tt> values to a safe character set (for example <tt>[A-Za-z0-9_- ]</tt>) before rendering.</p>"}],"value":"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."}],"x_generator":{"engine":"cvelib 1.8.0"}},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"other":{"type":"ssvc","content":{"timestamp":"2026-06-29T19:18:13.166991Z","id":"CVE-2026-53427","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"partial"}],"role":"CISA Coordinator","version":"2.0.3"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2026-06-29T19:19:28.028Z"}}]}}}