Technical impact
An uncontrolled recursion flaw in leandrocp’s mdex permits an attacker to feed a Markdown document with thousands of nested block quotes. The mdex library converts between Elixir %MDEx.Document% structs and Comrak’s internal AST using two mutually recursive Rust functions, ex_document_to_comrak_ast and comrak_ast_to_ex_document, which lack a maximum‑depth check. When an attacker invokes MDEx.parse_document!/1 or MDEx.to_html/1 with such a deeply nested document, unbounded recursion is pushed across the NIF boundary and depletes the native C stack. The resulting stack overflow triggers an uncatchable SIGSEGV in the NIF, causing the operating system process that hosts the BEAM to terminate and bringing down every Erlang and Elixir process on the node. No authentication or special privileges are required. After the developers extracted the vulnerable conversion logic into the separate mdex_native package in mdex 0.12.3, the issue was mitigated, but versions before that remain affected.
Affected Systems
The vulnerability affects the leandrocp mdex library from version 0.3.0 up to, but not including, 0.12.3, and the mdex_native package from 0.1.0 up to, but not including, 0.2.3. Versions newer than those contain the necessary recursion‑depth mitigation implemented in a recent commit.
Risk and Exploitability
With a CVSS score of 6.9 the risk is moderate, but because the crash is uncontainable within the BEAM and the attacker can supply Markdown through any exposed parse or render call, the practical danger is high. The EPSS score of 0.00237 indicates a very low but non‑zero probability of exploitation, and the vulnerability is not listed in the CISA KEV catalog, yet the lack of authentication and the severity of a full node crash make immediate attention warranted. An attacker who can inject Markdown – even via user‑generated content – can trigger an immediate and total denial of service.