Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessIdentify endpoint rendering user-supplied MDEx documents
-
DeliveryCraft document with many large EscapedTag literal strings
-
ExploitSubmit repeated render requests at low rate
-
ExecutionNative Rust heap leaks accumulate across requests
-
PersistBEAM VM process exhausts OS memory
-
ImpactNode-wide crash kills all co-located services
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Resource cleanup, leak prevention
|
| Exploitation Conditions | Exploitation requires three specific conditions: (1) the application must pass user-controlled content to MDEx.to_html/1 or any other API that renders an %MDEx.Document{} struct - applications that render only static, developer-authored documents are not at risk; (2) the user-supplied document must contain at least one %MDEx.EscapedTag{} node, as only this specific node type triggers the Box::leak path (other node types in a document are not affected); and (3) the attacker must be able to invoke rendering repeatedly, as a single render leaks memory proportional to literal size but a crash requires accumulation across many renders. Authentication is not required by the library itself - whether the rendering endpoint is protected depends on the application's own access controls. There is no configuration flag that enables or disables the vulnerable code path; all versions of mdex 0.11.0-0.12.2 and mdex_native 0.1.0-0.2.2 that process escaped-tag nodes are unconditionally affected. The BEAM process model amplifies impact: a crash is node-wide, not request-scoped, so a single successful exhaustion attack kills every Erlang/Elixir process on the node. |
| Impact | The CNA-assigned CVSS 4.0 vector (AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N, score 6.9) designates AV:L (Local), which may understate real-world exposure: the CVE description explicitly states that any application rendering documents derived from user-supplied content is affected, which in Elixir/Phoenix deployments typically means a network-facing endpoint - an AV:N assessment is arguably more representative of attacker reachability. No EPSS score was provided in the available data, and the vulnerability is not listed in CISA KEV; no public exploit code exists at time of analysis. However, the attack concept requires no expertise - constructing a document with large escaped-tag literals is trivial. The severity is compounded by the BEAM process model: a crash kills every co-located Erlang/Elixir process on the node, not just the request handler, making the blast radius disproportionate to the 6.9 score. Impact is strictly availability (A:H); there is no confidentiality or integrity exposure. The absence of KEV listing and public POC tempers urgency, but the patch is available and straightforward to apply. |
| Exploit ScenarioDerived | An attacker targeting a Phoenix web application that renders user-submitted Elixir document structures sends repeated HTTP requests containing documents with hundreds of %MDEx.EscapedTag{} nodes each carrying multi-kilobyte literal strings. Each call to MDEx.to_html/1 silently leaks native Rust heap memory that the BEAM VM can never reclaim; across dozens of requests submitted slowly to avoid rate limits, the node's resident memory climbs steadily until the OS kills the BEAM process, crashing the entire application and all co-located services simultaneously. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Jun 29, 2026
Native Rust heap exhaustion in leandrocp mdex and mdex_native allows any attacker who can supply document content to MDEx.to_html/1 to crash the BEAM Erlang/Elixir node through unbounded memory accumulation. The Rust NIF permanently leaks memory by calling Box::leak on every escaped-tag literal string during document rendering, with no size cap or rate limit - leakage compounds across repeated renders proportional to literal_size multiplied by node_count, and the BEAM VM can never reclaim native allocations once surrendered this way. No public exploit code has been identified and the vulnerability is not listed in CISA KEV; vendor-released patches are available in mdex 0.12.3 and mdex_native 0.2.3.
RemediationAI
The primary fix is to upgrade mdex to version 0.12.3 or later and mdex_native to version 0.2.3 or later, which remove the Box::leak call in the EscapedTag conversion path; the upstream patch commit is cbd927fb5061b488de8d90a8ef6df65718ca1fe6 at https://github.com/leandrocp/mdex_native/commit/cbd927fb5061b488de8d90a8ef6df65718ca1fe6. If patching is not immediately feasible, the most targeted compensating control is to pre-validate or sanitize documents before rendering - specifically, strip or reject any %MDEx.EscapedTag{} nodes in documents sourced from untrusted user input before passing them to MDEx.to_html/1 or any other rendering API; this eliminates the vulnerable code path at the cost of losing escaped-tag rendering for user content. A secondary mitigation is to configure BEAM VM memory limits (e.g., via +MBas or OS-level cgroups) and ensure Erlang supervisors restart the node on OOM - this limits total damage but does not prevent the crash and introduces service interruption. Rate-limiting rendering endpoints is a weak compensating control since the leak is permanent and accumulates even at low request rates.
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
mdex and its extracted dependency mdex_native are Elixir libraries that wrap a Rust NIF (Native Implemented Function) built on the comrak CommonMark parser. The vulnerability, identified as CWE-401 (Missing Release of Memory after Effective Lifetime), resides in the From<ExEscapedTag> for NodeValue trait implementation inside native/comrak_nif/src/types/document.rs (mdex) and native/mdex_native_nif/src/types/document.rs (mdex_native). When converting an %MDEx.EscapedTag{} Elixir struct node into its native Rust NodeValue representation, the code calls Box::leak on the caller-supplied literal string. Box::leak in Rust intentionally transfers ownership of a heap allocation to the OS process, bypassing the Rust borrow checker's drop mechanism and preventing deallocation for the entire process lifetime. Because NIFs live outside the BEAM VM's garbage-collected heap, the BEAM allocator has no visibility into these native allocations and cannot reclaim them, even between requests. The affected CPE entries are cpe:2.3:a:leandrocp:mdex and cpe:2.3:a:leandrocp:mdex_native.
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
The library is reached through network-facing application endpoints rendering user content; the library imposes no authentication; impact is availability-only with no scope change.
Primary rating from Vendor (EEF).
CVSS VectorVendor: EEF
DescriptionCVE.org
Missing Release of Memory after Effective Lifetime vulnerability in leandrocp mdex and mdex_native allows an attacker who controls a rendered document to cause a denial of service through unbounded native memory exhaustion.
The native rendering code permanently leaks memory when rendering a document that contains escaped-tag nodes. The conversion of each %MDEx.EscapedTag{} node into its native representation (From<ExEscapedTag> for NodeValue in the Rust NIF) calls Box::leak on the caller-supplied literal string, which surrenders the backing allocation so that it lives for the entire lifetime of the operating system process and is never freed.
Both the byte length of each literal and the number of escaped-tag nodes in a document are attacker-controlled, and there is no size cap, rate limit, or string interning on this path. Every render of a document containing escaped-tag nodes therefore leaks literal_size x node_count bytes that can never be reclaimed, and repeated renders accumulate without bound. Rendering reaches this path through the public MDEx.to_html/1 entry point and any other API that renders a supplied %MDEx.Document{}.
Any application that uses mdex (or mdex_native directly) to render documents derived from user-supplied content is affected. Because the leaked memory is never reclaimed for the life of the BEAM process, an attacker can drive resident memory upward without limit until the node exhausts memory and crashes, taking down every process on it.
The vulnerable native code originally shipped inside mdex (in native/comrak_nif/src/types/document.rs) and was later extracted into the separate mdex_native package (native/mdex_native_nif/src/types/document.rs), where it remains unpatched.
This issue affects mdex from 0.11.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
Stack exhaustion in the mdex and mdex_native Elixir Markdown libraries causes entire-node denial of service when process
Unbounded memory allocation in the MDEx Elixir Markdown rendering library allows a remote unauthenticated attacker to ex
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-40176
NVD
CVE.org
EPSS
Vulnrichment
GitHub
VulDB
Exploit-DB