{"id":"CVE-2026-53428","aliases":["CVE-2026-53428","EEF-CVE-2026-53428","GHSA-j93q-9cvj-rxfm"],"related":[],"kind":"vulnerability","state":"published","title":"Unbounded memory allocation in highlight_lines range expansion in mdex","summary":"Memory Allocation with Excessive Size Value vulnerability in leandrocp mdex allows an unauthenticated attacker to cause a denial of service through unbounded memory allocation.\n\ncomrak_nif::lumis_adapter::LumisAdapter::parse_highlight_lines in native/comrak_nif/src/lumis_adapter.rs eagerly expands a user-controlled inclusive line range from a fenced code block's highlight_lines decorator into a Vec<usize>, pushing one element per integer in the range with no upper bound on the range size. An attacker who can supply Markdown that an application renders with MDEx.to_html/2 (for example a comment, chat message, or wiki page) can embed a code block whose info string is rust highlight_lines=\"1-100000000\", forcing the native adapter to allocate roughly 8 bytes per line in the range.\n\nA payload that differs by only a few bytes can therefore allocate hundreds of megabytes, and a sufficiently large range (for example 1-2000000000) exhausts host memory and aborts the BEAM, denying service to every user of the rendering process. The per-line write loop additionally tests membership with a linear scan over the same vector, degrading rendering to a quadratic cost even for ranges that do not immediately exhaust memory.\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.11.0 before 0.12.3; mdex_native: from 0.1.0 before 0.2.3.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Memory Allocation with Excessive Size Value vulnerability in leandrocp mdex allows an unauthenticated attacker to cause a denial of service through unbounded memory allocation.\n\ncomrak_nif::lumis_adapter::LumisAdapter::parse_highlight_lines in native/comrak_nif/src/lumis_adapter.rs eagerly expands a user-controlled inclusive line range from a fenced code block's highlight_lines decorator into a Vec<usize>, pushing one element per integer in the range with no upper bound on the range size. An attacker who can supply Markdown that an application renders with MDEx.to_html/2 (for example a comment, chat message, or wiki page) can embed a code block whose info string is rust highlight_lines=\"1-100000000\", forcing the native adapter to allocate roughly 8 bytes per line in the range.\n\nA payload that differs by only a few bytes can therefore allocate hundreds of megabytes, and a sufficiently large range (for example 1-2000000000) exhausts host memory and aborts the BEAM, denying service to every user of the rendering process. The per-line write loop additionally tests membership with a linear scan over the same vector, degrading rendering to a quadratic cost even for ranges that do not immediately exhaust memory.\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.11.0 before 0.12.3; mdex_native: from 0.1.0 before 0.2.3.","source":"cvelist"},{"lang":"en","text":"## Summary\n\nMemory Allocation with Excessive Size Value vulnerability in leandrocp mdex allows an unauthenticated attacker to cause a denial of service through unbounded memory allocation.\n\n`comrak_nif::lumis_adapter::LumisAdapter::parse_highlight_lines` in `native/comrak_nif/src/lumis_adapter.rs` eagerly expands a user-controlled inclusive line range from a fenced code block's `highlight_lines` decorator into a `Vec<usize>`, pushing one element per integer in the range with no upper bound on the range size. An attacker who can supply Markdown that an application renders with `MDEx.to_html/2` (for example a comment, chat message, or wiki page) can embed a code block whose info string is `rust highlight_lines=\"1-100000000\"`, forcing the native adapter to allocate roughly 8 bytes per line in the range.\n\nA payload that differs by only a few bytes can therefore allocate hundreds of megabytes, and a sufficiently large range (for example `1-2000000000`) exhausts host memory and aborts the BEAM, denying service to every user of the rendering process. The per-line write loop additionally tests membership with a linear scan over the same vector, degrading rendering to a quadratic cost even for ranges that do not immediately exhaust memory.\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.11.0 before 0.12.3; mdex_native: from 0.1.0 before 0.2.3.\n\n## Workarounds\n\nDo not enable code-block decorators: leave the `github_pre_lang` and `full_info_string` render options unset, or avoid configuring an inline syntax-highlight formatter, so that `highlight_lines` specifications are never parsed.\n\n## Configurations\n\nExploitation requires the application to enable code-block decorators. Decorators are active only when the render options `github_pre_lang` and `full_info_string` are both set and an inline syntax-highlight formatter (for example `{:html_inline, ...}`) is configured. Applications that render Markdown with the default options do not parse `highlight_lines` specifications and are not affected.","format":"markdown","source":"eef"}],"published":"2026-06-29T18:52:36.199Z","modified":"2026-11-26T17:23:06.143Z","severity":{"scorer":"EEF","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:H","score":6.9,"rating":"MEDIUM"},"severities":[{"scorer":"EEF","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:H","score":6.9,"rating":"MEDIUM"},{"scorer":"Erlang Ecosystem Foundation","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:H"}],"cwes":["CWE-789"],"affected":[{"ranges":[{"type":"semver","introduced":"0.11.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":"a8407611715d1ead35fbcba79c72cef1b7df387b","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":"798a363b4339f6f7162ec8437c4c9f9b5ae6fbf3","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.11.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":"a8407611715d1ead35fbcba79c72cef1b7df387b","status":"affected","fixed":"6ed94d905f97af188323f042698ae841c02293b4"}],"repo":"https://github.com/leandrocp/mdex","source":"eef"},{"ranges":[{"type":"git","introduced":"956528c5e31746253347029e810a969ab916fd27","status":"affected","fixed":"798a363b4339f6f7162ec8437c4c9f9b5ae6fbf3"}],"repo":"https://github.com/leandrocp/mdex_native","source":"eef"}],"references":[{"url":"https://github.com/leandrocp/mdex_native/security/advisories/GHSA-j93q-9cvj-rxfm","tags":["advisory","related","vendor-advisory"],"sources":["cvelist","eef","nvd"]},{"url":"https://cna.erlef.org/cves/CVE-2026-53428.html","tags":["related","web"],"sources":["cvelist","eef","nvd"]},{"url":"https://osv.dev/vulnerability/EEF-CVE-2026-53428","tags":["related"],"sources":["cvelist","nvd"]},{"url":"https://github.com/leandrocp/mdex/commit/a8407611715d1ead35fbcba79c72cef1b7df387b","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/798a363b4339f6f7162ec8437c4c9f9b5ae6fbf3","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:17:11.005Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-53428","url":"https://www.cve.org/CVERecord?id=CVE-2026-53428","licence":"CVE Terms of Use","modified":"2026-11-20T09:00:44.068Z"},{"source":"eef","name":"Erlang Ecosystem Foundation","id":"EEF-CVE-2026-53428","url":"https://osv.dev/vulnerability/EEF-CVE-2026-53428","licence":"CC-BY-4.0","modified":"2026-11-26T17:23:06.143Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-53428","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-53428","licence":"Public domain","modified":"2026-11-20T09:20:13.933Z"}],"updatedAt":"2026-11-26T17:37:07.020Z","epss":{"score":0.00143,"percentile":0.03797,"date":"2026-12-01T12:00:22.000Z"}}