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

Status: published. Published: 2026-06-29. Updated: 2026-11-24.

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.

## Remediation

- fix: The reporting source identifies this reference as a patch. Check the advisory for affected versions and supported release branches. (source: CNA: EEF) — https://github.com/leandrocp/mdex/commit/6ed94d905f97af188323f042698ae841c02293b4
- fix: The reporting source identifies this reference as a patch. Check the advisory for affected versions and supported release branches. (source: CNA: EEF) — https://github.com/leandrocp/mdex_native/commit/947696c47bc22bea5dffc0f78c946fa6b70ce183

## Affected products and versions

- leandrocp / mdex (mdex): ≥ 0.3.0; < 0.12.3 (affected, semver). Source: CNA: EEF
- leandrocp / mdex (leandrocp/mdex): ≥ d0bc7d55177727c61d188ef465178ab3b81f4f2c; < 6ed94d905f97af188323f042698ae841c02293b4 (affected, git). Source: CNA: EEF
- leandrocp / mdex_native (mdex_native): ≥ 0.1.0; < 0.2.3 (affected, semver). Source: CNA: EEF
- leandrocp / mdex_native (leandrocp/mdex_native): ≥ 956528c5e31746253347029e810a969ab916fd27; < 947696c47bc22bea5dffc0f78c946fa6b70ce183 (affected, git). Source: CNA: EEF

## Severity and prioritization

- 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; source: CNA: EEF

- CISA KEV: No listing in collected sources

- EPSS: 0.24% as of 2026-11-23; percentile 14.83%

- SSVC: exploitation poc; automatable no; technical impact partial; source ADP: CISA-ADP

- Weaknesses: CWE-674

## Exploit evidence

- exploit: https://github.com/leandrocp/mdex_native/security/advisories/GHSA-3w4f-53g2-f66p (ADP: CISA-ADP)

## References

- https://github.com/leandrocp/mdex_native/security/advisories/GHSA-3w4f-53g2-f66p (CNA: EEF; vendor-advisory, related)

- https://cna.erlef.org/cves/CVE-2026-54888.html (CNA: EEF; related)

- https://osv.dev/vulnerability/EEF-CVE-2026-54888 (CNA: EEF; related)

- https://github.com/leandrocp/mdex/commit/d0bc7d55177727c61d188ef465178ab3b81f4f2c (CNA: EEF; related)

- https://github.com/leandrocp/mdex/commit/6ed94d905f97af188323f042698ae841c02293b4 (CNA: EEF; patch)

- https://github.com/leandrocp/mdex_native/commit/956528c5e31746253347029e810a969ab916fd27 (CNA: EEF; related)

- https://github.com/leandrocp/mdex_native/commit/947696c47bc22bea5dffc0f78c946fa6b70ce183 (CNA: EEF; patch)

- https://github.com/leandrocp/mdex_native/security/advisories/GHSA-3w4f-53g2-f66p (ADP: CISA-ADP; exploit)

## Provenance

- CNA: EEF: https://www.cve.org/CVERecord?id=CVE-2026-54888; retrieved 2026-11-24; source updated 2026-11-24

- FIRST EPSS: https://api.first.org/data/v1/epss?cve=CVE-2026-54888; retrieved 2026-11-24; source updated Not reported

Revision: 1e089965e7398c6cf0ed3b57074f3a6b93fba6a08739e3158d122472834a4e50

Canonical: https://y2.dev/cve/CVE-2026-54888

## Agent and API access

Public CVE pages, Markdown, and JSON are free to read without an account or API key.

- Public catalog: https://y2.dev/cve/index.json. Follow nextCursor with the same search, filters, sort, and limit (1–100). A null cursor marks the end.

- WebMCP: search_cve_disclosures, get_cve_disclosure, get_cve_page_markdown, get_y2_cve_access. Available in compatible browsers.

- Cyber API: https://api.y2.dev/api/v2/cyber/cves and https://api.y2.dev/api/v2/cyber/cves/{cveId}.

- Y2 Pro or Elite: create a workspace API key with the intel:cyber scope and send Authorization: Bearer <Y2_API_KEY>. Setup: https://y2.dev/docs/api/create-key.

- x402: Pay per request without an account or API key. Omit Authorization, read the HTTP 402 PAYMENT-REQUIRED challenge, validate its current requirements, and retry with PAYMENT-SIGNATURE through an authorized payment client. These browser tools never make payments. Guide: https://y2.dev/docs/api/x402.

- OpenAPI: https://y2.dev/api/openapi.yaml. Agent access metadata: https://y2.dev/cve/agent.json.

Collected public records only. Check source status for coverage and freshness.