CVE-2026-54888

Uncontrolled recursion over deeply nested Markdown crashes the BEAM in mdex

6.9 medium EPSS 0.25%

Published 29 Jun 2026 Updated 24 Nov 2026 CNA: EEF

Check your servers for CVE-2026-54888

The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2026-54888 affects mdex, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.

Check my servers

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.

Severity (CVSS)

6.9 medium CVSS 4.0 from EEF (CNA)
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
Attack vector
local: the attacker needs local access, or a user has to open a prepared file
Attack complexity
low: an attack works without special conditions
Attack requirements
none: an attack works without special conditions on the target
Privileges required
none: the attacker does not need an account
User interaction
none: nobody has to click or open anything
Impact on the vulnerable system
confidentiality none, integrity none, availability high: what an attacker can read, change or stop in the vulnerable component
Impact on other systems
confidentiality none, integrity none, availability none: what an attacker can read, change or stop beyond it

Exploitation

EPSS 0.25%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 9.47% of all scored CVEs. Scores of 30 Nov 2026.

The assessment of CISA (SSVC, 29 Jun 2026):

Exploitation
poc: a proof of concept is public
Automatable
no: each attack takes manual steps
Technical impact
partial: limited control or limited data

Weakness

Affected products

As the CNA lists them.

ProductVersions
mdex
package mdex
affected from 0.3.0, before 0.12.3
Other versions: unaffected
mdex
package leandrocp/mdex
affected from d0bc7d55177727c61d188ef465178ab3b81f4f2c, before 6ed94d905f97af188323f042698ae841c02293b4
Other versions: unaffected
mdex_native
package mdex_native
affected from 0.1.0, before 0.2.3
Other versions: unaffected
mdex_native
package leandrocp/mdex_native
affected from 956528c5e31746253347029e810a969ab916fd27, before 947696c47bc22bea5dffc0f78c946fa6b70ce183
Other versions: unaffected

Is my server affected?

Find the installed version of mdex and compare it with the fixed version of your distribution. Distributions often fix a CVE in a package version of their own, so the version number of the upstream project can mislead.

Debian, Ubuntu

dpkg -l | grep -i mdex
# packages whose changelog names the CVE (fixed in the installed version)
zgrep -l CVE-2026-54888 /usr/share/doc/*/changelog.Debian.gz
# Ubuntu
pro fix CVE-2026-54888

RHEL, Rocky, Alma, Fedora

rpm -q mdex
# lists the advisory while the fix is not installed
dnf updateinfo list --cve CVE-2026-54888

Alpine

apk list --installed | grep -i mdex

With Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:

trivy rootfs --scanners vuln / | grep CVE-2026-54888
trivy image --scanners vuln IMAGE | grep CVE-2026-54888

Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.

References

Patches and release notes

Exploits and proof of concept

Other references

Source: the record CVE-2026-54888 of the CVE List (CVE Program), CVE Terms of Use; the CISA KEV catalog and the CISA ADP container; EPSS of FIRST; the CWE catalog of MITRE, CWE Terms of Use. The text of the record is shown as published. Data sources and licences.