Hex
CVE-2026-54888
Uncontrolled recursion over deeply nested Markdown crashes the BEAM in mdex
- Severity
- Medium 6.9
- Published
- 29 Jun 2026
- Last changed
- 24 Nov 2026
- Added to UpHeron
- 24 Nov 2026
- Fixed in
- 0.2.3, 0.12.3
- Exploit chance
- 0.2% in the next 30 daysHigher than 14% of CVEs. EPSS by FIRST, 24 Nov 2026
- Weakness
- Uncontrolled recursion (CWE-674)
- Attack
- Needs local access · No login needed · No user action needed
- Attacker can
- Take it down
- CVSS vector
CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N- Sources
- CVE Program
Description
Uncontrolled Recursion vulnerability in leandrocp mdex allows denial of service via deeply nested Markdown input.
mdex converts between an Elixir %MDEx.Document{} struct and Comrak's internal AST using two mutually recursive Rust functions, ex_document_to_comrak_ast and comrak_ast_to_ex_document, in the NIF source file document.rs. Neither function enforces a maximum nesting depth, so the recursion depth is bounded only by the structure of the input. An attacker who can get a Markdown document rendered (for example through MDEx.parse_document!/1 or MDEx.to_html/1) can supply a document with thousands of nested block quotes, which drives unbounded recursion across the NIF boundary and exhausts the native C stack.
Because the resulting stack overflow is an uncatchable SIGSEGV raised inside a NIF, it cannot be contained by the Erlang runtime. It terminates the operating system process running the BEAM, killing every Elixir and Erlang process on the node, not just the caller that…
Affected software
| Software | Affected versions |
|---|---|
mdexHex · osv:Hex:mdex |
|
mdex_nativeHex · osv:Hex:mdex_native |
|
About mdex
Vulnerabilities in mdex
- In our list
- 2
- Published in the last 12 months
- 2
- Critical, last 12 months
- 0
- High, last 12 months
- 0
- Known exploited
- 0
- CVE-2026-54889Unsanitized URL schemes in MDEx Quill Delta output allow javascript: injection (XSS)Medium 5.1 29 Jun 2026
About mdex_native
This is the only vulnerability in mdex_native in our list.
References
- CVE.org https://www.cve.org/CVERecord?id=CVE-2026-54888