Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

CVE-2026-54888: CWE-674 Uncontrolled Recursion in leandrocp mdex

0
Medium
VulnerabilityCVE-2026-54888cvecve-2026-54888cwe-674
Published: 06/29/2026 (06/29/2026, 19:10:38 UTC)
Source: CVE Database V5
Vendor/Project: leandrocp
Product: mdex

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 and mdex_native from 0.1.0 before 0.2.3.

CVSS v4.0

Score 6.9medium

Attack Vector
Local
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
None
Vuln. Confidentiality
None
Vuln. Integrity
None
Vuln. Availability
High
Subsq. Confidentiality
None
Subsq. Integrity
None
Subsq. Availability
None
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

Affected software

mdex
pkg:hex/mdex
Affected versions
>=0.3.0 <0.12.3
GitHub Actionsmore threats →cve
leandrocp/mdex
pkg:github/leandrocp/mdex
mdex_native
pkg:hex/mdex_native
Affected versions
>=0.1.0 <0.2.3
GitHub Actionsmore threats →cve
leandrocp/mdex_native
pkg:github/leandrocp/mdex_native
CPE configurations (2)
cpe:2.3:a:leandrocp:mdex:*:*:*:*:*:*:*:*
cpe:2.3:a:leandrocp:mdex_native:*:*:*:*:*:*:*:*

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 06/29/2026, 19:51:34 UTC

Technical Analysis

The vulnerability in mdex involves two mutually recursive Rust functions, ex_document_to_comrak_ast and comrak_ast_to_ex_document, which convert between Elixir %MDEx.Document{} structs and Comrak's internal AST. These functions do not limit recursion depth, allowing an attacker to supply Markdown documents with thousands of nested block quotes. This unbounded recursion causes a stack overflow in the native code, resulting in an uncatchable SIGSEGV inside a NIF (Native Implemented Function). The Erlang runtime cannot contain this fault, causing the entire BEAM process to terminate and killing all Elixir and Erlang processes on the node. The vulnerability affects mdex versions >=0.3.0 and <0.12.3 and mdex_native versions >=0.1.0 and <0.2.3. There is no indication of a vendor-provided patch or remediation level in the provided data.

Potential Impact

Exploitation of this vulnerability allows an attacker to cause a denial of service by crashing the BEAM virtual machine process hosting Elixir and Erlang applications. This results in a complete termination of all running processes on the node, not just the one processing the malicious Markdown input. No authentication or special privileges are required, increasing the risk of exploitation in environments where untrusted Markdown input is rendered.

Mitigation Recommendations

Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until an official fix is available, avoid rendering untrusted Markdown input with affected versions of mdex and mdex_native. Consider implementing input validation or limiting Markdown nesting depth externally if possible. Monitor vendor channels for updates regarding patches or official mitigations.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Data Version
5.2
Assigner Short Name
EEF
Date Reserved
2026-06-16T10:47:13.915Z
Cvss Version
4.0
State
PUBLISHED
Remediation Level
null

Threat ID: 6a42c94c27e9c797196503dc

Added to database: 06/29/2026, 19:36:44 UTC

Last enriched: 06/29/2026, 19:51:34 UTC

Last updated: 06/29/2026, 20:59:26 UTC

Views: 5

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses