# CVE-2026-54888: Uncontrolled recursion over deeply nested Markdown crashes the BEAM in mdex

- Severity: Medium 6.9 (CVSS:4.0, scored by EEF) `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`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.24%, higher than 16% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2026-06-29T19:10:38.151Z
- Modified: 2026-11-26T17:23:06.143Z
- Also known as: EEF-CVE-2026-54888, GHSA-3w4f-53g2-f66p
- Weaknesses: CWE-674
- SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial
- Assigned by: EEF

## 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 triggered the render. No authentication or special privileges are required.

The vulnerable conversion code was extracted from mdex into the separate mdex_native package starting in mdex 0.12.3.

This issue affects mdex: from 0.3.0 before 0.12.3; mdex_native: from 0.1.0 before 0.2.3.

(As written by CVE List.)

## Affected

- mdex: from 0.3.0 before 0.12.3
- leandrocp/mdex: from d0bc7d55177727c61d188ef465178ab3b81f4f2c before 6ed94d905f97af188323f042698ae841c02293b4
- mdex_native: from 0.1.0 before 0.2.3
- leandrocp/mdex_native: from 956528c5e31746253347029e810a969ab916fd27 before 947696c47bc22bea5dffc0f78c946fa6b70ce183
- mdex (Hex): from 0.3.0 before 0.12.3
- mdex_native (Hex): from 0.1.0 before 0.2.3
- https://github.com/leandrocp/mdex: from d0bc7d55177727c61d188ef465178ab3b81f4f2c before 6ed94d905f97af188323f042698ae841c02293b4
- https://github.com/leandrocp/mdex_native: from 956528c5e31746253347029e810a969ab916fd27 before 947696c47bc22bea5dffc0f78c946fa6b70ce183

## Every score

- EEF: CVSS:4.0 6.9 Medium `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`
- Erlang Ecosystem Foundation: CVSS:4.0 `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`

## References

- <https://github.com/leandrocp/mdex_native/security/advisories/GHSA-3w4f-53g2-f66p> (exploit, advisory, related, vendor-advisory)
- <https://cna.erlef.org/cves/CVE-2026-54888.html> (related, web)
- <https://osv.dev/vulnerability/EEF-CVE-2026-54888> (related)
- <https://github.com/leandrocp/mdex/commit/d0bc7d55177727c61d188ef465178ab3b81f4f2c> (related, web)
- <https://github.com/leandrocp/mdex/commit/6ed94d905f97af188323f042698ae841c02293b4> (fix, patch)
- <https://github.com/leandrocp/mdex_native/commit/956528c5e31746253347029e810a969ab916fd27> (related, web)
- <https://github.com/leandrocp/mdex_native/commit/947696c47bc22bea5dffc0f78c946fa6b70ce183> (fix, patch)
- <https://hex.pm/packages/mdex> (package)
- <https://hex.pm/packages/mdex_native> (package)

## Sources

- CVE List: [CVE-2026-54888](https://www.cve.org/CVERecord?id=CVE-2026-54888), CVE Terms of Use, modified 2026-11-24
- Erlang Ecosystem Foundation: [EEF-CVE-2026-54888](https://osv.dev/vulnerability/EEF-CVE-2026-54888), CC-BY-4.0, modified 2026-11-26
- NVD: [CVE-2026-54888](https://nvd.nist.gov/vuln/detail/CVE-2026-54888), Public domain, modified 2026-11-24

---

Page: https://cve.day/CVE-2026-54888 · Whole record: https://cve.day/CVE-2026-54888.json · Rebuilt by cve.day 2026-11-26T17:37:05.640Z
