CVE-2026-53428: CWE-789 Memory Allocation with Excessive Size Value in leandrocp mdex
Memory Allocation with Excessive Size Value vulnerability in leandrocp mdex allows an unauthenticated attacker to cause a denial of service through unbounded memory allocation. comrak_nif::lumis_adapter::LumisAdapter::parse_highlight_lines in native/comrak_nif/src/lumis_adapter.rs eagerly expands a user-controlled inclusive line range from a fenced code block's highlight_lines decorator into a Vec<usize>, pushing one element per integer in the range with no upper bound on the range size. An attacker who can supply Markdown that an application renders with MDEx.to_html/2 (for example a comment, chat message, or wiki page) can embed a code block whose info string is rust highlight_lines="1-100000000", forcing the native adapter to allocate roughly 8 bytes per line in the range. A payload that differs by only a few bytes can therefore allocate hundreds of megabytes, and a sufficiently large range (for example 1-2000000000) exhausts host memory and aborts the BEAM, denying service to every user of the rendering process. The per-line write loop additionally tests membership with a linear scan over the same vector, degrading rendering to a quadratic cost even for ranges that do not immediately exhaust memory. The vulnerable native code originally shipped inside mdex (in native/comrak_nif/src/lumis_adapter.rs) and was later extracted into the separate mdex_native package (native/mdex_native_nif/src/lumis_adapter.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
The vulnerability in leandrocp mdex involves unbounded memory allocation caused by the parse_highlight_lines function in the native Rust code. This function eagerly expands a user-supplied inclusive line range from a fenced code block's highlight_lines decorator into a vector, allocating memory proportional to the range size without any upper limit. An attacker can supply Markdown with a large highlight_lines range (e.g., "1-100000000") to force allocation of hundreds of megabytes or more, exhausting host memory and causing the BEAM process to abort, resulting in denial of service. The quadratic time complexity of the per-line membership test further degrades performance. The vulnerable code was originally part of mdex and later moved to mdex_native, where it remains unpatched. The affected versions are mdex 0.11.0 up to but not including 0.12.3, and mdex_native 0.1.0 up to but not including 0.2.3.
Potential Impact
Successful exploitation allows an unauthenticated attacker to cause a denial of service by exhausting memory resources of the host running the mdex rendering process. This leads to the BEAM virtual machine aborting, disrupting service availability for all users relying on the rendering functionality. There is no indication of code execution or data corruption beyond denial of service.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. The vulnerability affects mdex versions from 0.11.0 before 0.12.3 and mdex_native from 0.1.0 before 0.2.3. Users should upgrade to versions 0.12.3 or later for mdex and 0.2.3 or later for mdex_native once available. Until patches are released, consider restricting or sanitizing user input that controls the highlight_lines range to prevent excessively large values.
CVE-2026-53428: CWE-789 Memory Allocation with Excessive Size Value in leandrocp mdex
Description
Memory Allocation with Excessive Size Value vulnerability in leandrocp mdex allows an unauthenticated attacker to cause a denial of service through unbounded memory allocation. comrak_nif::lumis_adapter::LumisAdapter::parse_highlight_lines in native/comrak_nif/src/lumis_adapter.rs eagerly expands a user-controlled inclusive line range from a fenced code block's highlight_lines decorator into a Vec<usize>, pushing one element per integer in the range with no upper bound on the range size. An attacker who can supply Markdown that an application renders with MDEx.to_html/2 (for example a comment, chat message, or wiki page) can embed a code block whose info string is rust highlight_lines="1-100000000", forcing the native adapter to allocate roughly 8 bytes per line in the range. A payload that differs by only a few bytes can therefore allocate hundreds of megabytes, and a sufficiently large range (for example 1-2000000000) exhausts host memory and aborts the BEAM, denying service to every user of the rendering process. The per-line write loop additionally tests membership with a linear scan over the same vector, degrading rendering to a quadratic cost even for ranges that do not immediately exhaust memory. The vulnerable native code originally shipped inside mdex (in native/comrak_nif/src/lumis_adapter.rs) and was later extracted into the separate mdex_native package (native/mdex_native_nif/src/lumis_adapter.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
The vulnerability in leandrocp mdex involves unbounded memory allocation caused by the parse_highlight_lines function in the native Rust code. This function eagerly expands a user-supplied inclusive line range from a fenced code block's highlight_lines decorator into a vector, allocating memory proportional to the range size without any upper limit. An attacker can supply Markdown with a large highlight_lines range (e.g., "1-100000000") to force allocation of hundreds of megabytes or more, exhausting host memory and causing the BEAM process to abort, resulting in denial of service. The quadratic time complexity of the per-line membership test further degrades performance. The vulnerable code was originally part of mdex and later moved to mdex_native, where it remains unpatched. The affected versions are mdex 0.11.0 up to but not including 0.12.3, and mdex_native 0.1.0 up to but not including 0.2.3.
Potential Impact
Successful exploitation allows an unauthenticated attacker to cause a denial of service by exhausting memory resources of the host running the mdex rendering process. This leads to the BEAM virtual machine aborting, disrupting service availability for all users relying on the rendering functionality. There is no indication of code execution or data corruption beyond denial of service.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. The vulnerability affects mdex versions from 0.11.0 before 0.12.3 and mdex_native from 0.1.0 before 0.2.3. Users should upgrade to versions 0.12.3 or later for mdex and 0.2.3 or later for mdex_native once available. Until patches are released, consider restricting or sanitizing user input that controls the highlight_lines range to prevent excessively large values.
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: 6a42c23927e9c79719595c04
Added to database: 06/29/2026, 19:06:33 UTC
Last enriched: 07/06/2026, 22:42:58 UTC
Last updated: 08/12/2026, 12:41:10 UTC
Views: 80
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.