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…
EPSS 0.2%top 94%

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: 07/06/2026, 22:43:09 UTC

Technical Analysis

The mdex library for Elixir uses two mutually recursive Rust functions in its NIF implementation to convert between Elixir %MDEx.Document{} structs and Comrak's internal AST. These functions, ex_document_to_comrak_ast and comrak_ast_to_ex_document, do not limit recursion depth, allowing an attacker to craft Markdown documents with excessive nesting (e.g., thousands of nested block quotes). This leads to unbounded recursion and stack overflow in native code, causing a SIGSEGV that crashes the BEAM virtual machine process. The crash affects the entire Erlang/Elixir node, not just the invoking process. The vulnerability requires no privileges and can be triggered by any user able to render Markdown via MDEx.parse_document!/1 or MDEx.to_html/1. The issue exists in mdex versions >=0.3.0 and <0.12.3 and in mdex_native >=0.1.0 and <0.2.3.

Potential Impact

Exploitation results in a denial of service by crashing the entire BEAM virtual machine process running Elixir and Erlang applications on the affected node. This is due to an uncatchable segmentation fault caused by stack overflow in native code. The impact is high availability disruption, affecting all processes on the node, with no need for authentication or special privileges.

Mitigation Recommendations

Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. No official fix or patch is documented in the provided data. Until a patch is available, avoid rendering untrusted Markdown input with mdex or mdex_native versions affected by this vulnerability. Consider applying input validation or limiting recursion depth externally if possible.

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: 07/06/2026, 22:43:09 UTC

Last updated: 08/13/2026, 12:41:11 UTC

Views: 82

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