Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessSubmit crafted deeply nested Markdown document
-
DeliveryApplication calls MDEx.to_html/1 or MDEx.parse_document!/1
-
ExploitNIF invokes mutually recursive Rust AST conversion
-
ExecutionRecursion depth exceeds native C stack limit
-
PersistSIGSEGV raised inside NIF boundary
-
ImpactBEAM VM OS process terminates, killing all node processes
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Recursion depth limits
|
| Exploitation Conditions | The targeted application must use mdex or mdex_native to process Markdown content that is fully or partially attacker-controlled - for example, a blog editor, comment system, documentation renderer, or chat platform where users submit Markdown that is passed to MDEx.parse_document!/1 or MDEx.to_html/1. No authentication, session token, or elevated privileges are required at the mdex library level; the CVSS 4.0 vector confirms PR:N and UI:N. Exploitation is limited to code paths where attacker-supplied content reaches the NIF conversion functions without prior depth or size sanitization. Applications that only render trusted, internally generated Markdown with no external input path are not at risk. The SIGSEGV impact is not bounded to a single request handler or process - any invocation on the node triggers node-wide termination. |
| Impact | The CNA-assigned CVSS 4.0 vector (AV:L/AC:L/AT:N/PR:N/UI:N/VA:H) scores 6.9, reflecting high availability impact with no complexity or privilege requirements. However, the AV:L choice warrants scrutiny: the description explicitly states no authentication or special privileges are required and identifies mdex.parse_document!/1 and mdex.to_html/1 as entry points, which in typical Phoenix or Plug web applications are reachable from network-provided input. A realistic deployment attack surface is therefore network-vector, not local, and the moderate numeric score understates the operational impact. The blast radius is disproportionate to the raw score - a single crafted HTTP request can terminate an entire BEAM node, simultaneously killing every co-hosted Elixir and Erlang process regardless of their relationship to the caller. There is no CISA KEV listing and no public exploit has been identified at time of analysis; EPSS data was not provided in the available intelligence. From an SSVC perspective the technique is trivially automatable (craft a text file with deeply nested block quotes), the technical impact is total availability loss for the node, and exploitation requires zero complexity beyond knowledge of the public description. Despite the moderate CVSS score, the node-wide crash amplification and the trivially constructable payload elevate real-world priority for any application that exposes mdex rendering to untrusted input. |
| Exploit ScenarioDerived | An attacker targeting a Phoenix web application or any Elixir service that renders user-supplied Markdown submits an HTTP request containing a document composed of thousands of consecutively nested block quote markers. When the application calls MDEx.to_html/1 or MDEx.parse_document!/1, the NIF's mutually recursive AST conversion exhausts the native C stack, raising a SIGSEGV that the Erlang runtime cannot intercept. The entire BEAM VM process is terminated, simultaneously killing all Elixir and Erlang processes on the node. No public exploit code has been identified at time of analysis, but the attack payload is trivially constructable from the public description alone. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Jun 29, 2026
Stack exhaustion in the mdex and mdex_native Elixir Markdown libraries causes entire-node denial of service when processing attacker-controlled deeply nested Markdown. Two mutually recursive Rust NIF functions, ex_document_to_comrak_ast and comrak_ast_to_ex_document in document.rs, traverse the Comrak AST without enforcing a maximum nesting depth; a document with thousands of nested block quotes drives unbounded recursion that overflows the native C stack. Because the resulting SIGSEGV is raised inside a NIF, the Erlang runtime cannot catch it - the OS process hosting the BEAM terminates, killing every Elixir and Erlang process on the node. No public exploit has been identified at time of analysis, but the attack requires only crafted Markdown input with no authentication.
RemediationAI
Upgrade mdex to version 0.12.3 or later, or mdex_native to version 0.2.3 or later; the upstream fix is available at commit 947696c47bc22bea5dffc0f78c946fa6b70ce183 (https://github.com/leandrocp/mdex_native/commit/947696c47bc22bea5dffc0f78c946fa6b70ce183), with the full advisory at https://github.com/leandrocp/mdex_native/security/advisories/GHSA-3w4f-53g2-f66p. If immediate patching is not feasible, the most effective compensating control is to enforce a maximum nesting depth or document size limit on Markdown input before it reaches any mdex API call - reject or truncate documents exceeding a safe threshold (such as 50 to 100 nesting levels of block quotes or list items) at the application layer; this adds input-validation overhead but prevents unbounded recursion from reaching the NIF boundary. As an architectural mitigation, isolating mdex rendering in a dedicated OTP application or separate OS subprocess with a supervisor that can restart on crash limits the blast radius from node-wide termination to a sandboxed process, though this requires non-trivial architectural changes and does not eliminate the underlying flaw.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 2 packages in euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
The vulnerability resides in the Rust NIF (Native Implemented Function) layer shared between mdex and its extracted sub-package mdex_native. NIFs execute native Rust/C code directly inside the BEAM OS process; unlike Erlang exceptions, signals raised inside NIFs - including SIGSEGV from stack overflow - bypass the Erlang supervisor tree entirely and cannot be isolated. CWE-674 (Uncontrolled Recursion) identifies the root cause: the two mutually recursive functions ex_document_to_comrak_ast and comrak_ast_to_ex_document mirror the AST structure of Comrak, a CommonMark-compliant Rust parser, without imposing any recursion depth limit. Deeply nested Markdown constructs such as cascaded block quotes produce an equally deep AST, and recursion depth scales linearly with nesting, quickly exceeding the native C stack. Affected CPEs are cpe:2.3:a:leandrocp:mdex (versions 0.3.0 through 0.12.2) and cpe:2.3:a:leandrocp:mdex_native (versions 0.1.0 through 0.2.2); the mdex_native package was introduced when the conversion code was refactored out of mdex starting at mdex 0.12.3.
Know when Mdex gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
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
Network vector for typical web-app deployment; scope changed because SIGSEGV inside the NIF terminates the entire BEAM VM, killing all co-hosted processes beyond the direct caller.
Primary rating from Vendor (EEF).
CVSS VectorVendor: EEF
DescriptionCVE.org
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.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.
Unauthenticated denial-of-service in MDEx, an Elixir/Erlang CommonMark parsing library, lets an attacker crash the entir
Unbounded memory allocation in the MDEx Elixir Markdown rendering library allows a remote unauthenticated attacker to ex
Native Rust heap exhaustion in leandrocp mdex and mdex_native allows any attacker who can supply document content to MDE
Cross-site scripting in MDEx (Elixir Markdown library by leandrocp), versions 0.8.3 through 0.13.1, allows any attacker
Stored and reflected cross-site scripting in MDEx's Lumis syntax highlighting adapter allows attackers who can submit Ma
EUVD-2026-40177
NVD
CVE.org
EPSS
Vulnrichment
GitHub
VulDB
Exploit-DB