Skip to main content

mdex CVE-2026-53429

| EUVDEUVD-2026-40176 MEDIUM
Memory Leak (CWE-401)
2026-06-29 EEF
6.9
CVSS 4.0 · Vendor: EEF
Share

Severity by source

Vendor (EEF) PRIMARY
6.9 MEDIUM
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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
vuln.today AI
7.5 HIGH

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.

3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
4.0 AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N

Primary rating from Vendor (EEF).

CVSS VectorVendor: EEF

Attack Vector
Local
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
X

Lifecycle Timeline

1
Analysis Generated
Jun 29, 2026 - 19:51 vuln.today

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.

AnalysisAI

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.

Technical ContextAI

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.

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.

Share

CVE-2026-53429 vulnerability details – vuln.today

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy