CVE-2026-53429: CWE-401 Missing Release of Memory after Effective Lifetime in leandrocp mdex
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.
AI Analysis
Technical Summary
This vulnerability arises from a missing release of memory after its effective lifetime in the native rendering code of leandrocp's mdex and mdex_native libraries. Specifically, when rendering documents with escaped-tag nodes, the conversion process uses Box::leak on caller-supplied literal strings, causing the backing memory to be permanently leaked and never freed. Both the size of each literal and the number of escaped-tag nodes are attacker-controlled without any imposed limits, allowing an attacker to cause unbounded native memory exhaustion. This leads to a denial of service by crashing the BEAM process due to memory exhaustion. The vulnerable code was originally part of mdex and later extracted into mdex_native, with the issue remaining unpatched. The vulnerability affects mdex versions from 0.11.0 up to but not including 0.12.3, and mdex_native from 0.1.0 up to but not including 0.2.3.
Potential Impact
An attacker who controls a rendered document can cause a denial of service by triggering unbounded native memory leaks. The memory leak is permanent for the lifetime of the BEAM process, leading to continuous growth in resident memory usage until exhaustion and process crash. This crash affects all processes on the host, resulting in service disruption.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. No official fix or patch is documented at this time. Until a fix is available, avoid rendering user-supplied documents containing escaped-tag nodes with mdex or mdex_native to prevent exploitation of this memory leak vulnerability.
CVE-2026-53429: CWE-401 Missing Release of Memory after Effective Lifetime in leandrocp mdex
Description
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.
CVSS v4.0
Score 6.9medium
Affected software
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.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
This vulnerability arises from a missing release of memory after its effective lifetime in the native rendering code of leandrocp's mdex and mdex_native libraries. Specifically, when rendering documents with escaped-tag nodes, the conversion process uses Box::leak on caller-supplied literal strings, causing the backing memory to be permanently leaked and never freed. Both the size of each literal and the number of escaped-tag nodes are attacker-controlled without any imposed limits, allowing an attacker to cause unbounded native memory exhaustion. This leads to a denial of service by crashing the BEAM process due to memory exhaustion. The vulnerable code was originally part of mdex and later extracted into mdex_native, with the issue remaining unpatched. The vulnerability affects mdex versions from 0.11.0 up to but not including 0.12.3, and mdex_native from 0.1.0 up to but not including 0.2.3.
Potential Impact
An attacker who controls a rendered document can cause a denial of service by triggering unbounded native memory leaks. The memory leak is permanent for the lifetime of the BEAM process, leading to continuous growth in resident memory usage until exhaustion and process crash. This crash affects all processes on the host, resulting in service disruption.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. No official fix or patch is documented at this time. Until a fix is available, avoid rendering user-supplied documents containing escaped-tag nodes with mdex or mdex_native to prevent exploitation of this memory leak vulnerability.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- EEF
- Date Reserved
- 2026-06-09T11:01:47.529Z
- Cvss Version
- 4.0
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a42c94c27e9c797196503d6
Added to database: 06/29/2026, 19:36:44 UTC
Last enriched: 07/06/2026, 22:43:03 UTC
Last updated: 08/13/2026, 00:41:12 UTC
Views: 147
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
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
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.