Skip to main content

MDEx CVE-2026-53428

| EUVDEUVD-2026-40175 MEDIUM
Memory Allocation with Excessive Size Value (CWE-789)
2026-06-29 EEF
6.9
CVSS 4.0 · Vendor: EEF
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Attacker crafts Markdown payload with oversized highlight_lines range
  2. Delivery
    Submits payload via public content form (comment, chat, wiki)
  3. Exploit
    Application passes unsanitized Markdown to MDEx.to_html/2
  4. Execution
    Native NIF allocates unbounded Vec<usize> in Rust heap
  5. Persist
    Host memory exhausted or BEAM abort signal triggered
  6. Impact
    Entire application process crashes, all active users denied service

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Memory allocation limits
Exploitation Conditions

The vulnerability is triggered when all of the following conditions are met: (1) the application calls MDEx.to_html/2 or an equivalent MDEx rendering function with user-controlled Markdown content; (2) the Markdown contains a fenced code block whose info string includes the highlight_lines decorator with a large integer range, e.g., highlight_lines="1-2000000000"; and (3) the application does not sanitize or cap the fenced code block info string before passing it to MDEx. Exploitation is limited to deployments where untrusted users can submit Markdown to a rendering pipeline backed by the affected MDEx versions - representative examples include public comment sections, chat systems, and editable wiki pages. Applications that only render Markdown authored by trusted administrators or from static files are not at risk. The CVSS 4.0 AT:P metric reflects this deployment-specific requirement. No authentication is required where the Markdown input surface is publicly accessible (PR:N). Exploitation is further limited to affected version ranges: mdex 0.11.0-0.12.2 and mdex_native 0.1.0-0.2.2.

Impact

The vendor-assigned CVSS 4.0 score of 6.9 uses AV:L (Local attack vector), which appears to reflect the NIF library's invocation context as a process-local component rather than the realistic end-to-end attack path. The CVE description explicitly identifies the exploitation surface as user-submitted content in web applications (comments, chat, wikis), making the practical attack vector network-accessible - a significant discrepancy that defenders must account for when triaging. The AT:P (Attack Requirements: Present) metric correctly captures the prerequisite that the application must route untrusted Markdown through MDEx. No KEV listing exists and no public exploit code has been published, but the attack requires no reverse engineering or tooling - any attacker who reads the advisory can construct a working payload in seconds, making POC-equivalent knowledge effectively public. The quadratic rendering cost (O(n²) linear scan) means that even range values below the memory-exhaustion threshold can cause significant availability degradation. The highest real-world risk applies to multi-tenant SaaS platforms, comment systems, and wikis where anonymous or low-trust users can submit Markdown; applications restricting Markdown input to trusted users face substantially lower exposure. EPSS data was not provided, but given the trivial constructability and the direct BEAM crash impact on all co-tenants, effective exploitation probability for exposed deployments is high.

Exploit ScenarioDerived

An attacker posts a comment on a web forum powered by an Elixir application using MDEx, embedding a fenced code block with the info string rust highlight_lines="1-2000000000" - a payload indistinguishable in length from a legitimate code block. When the server renders the page (server-side or on any user request), the MDEx NIF materializes approximately 16 GB of Vec<usize> allocation, exhausting host memory and aborting the BEAM process, taking the entire application offline for all concurrent users. No existing POC is known, but the payload requires no tooling beyond copying the range from the public advisory.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.1% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jun 29, 2026

Unbounded memory allocation in the MDEx Elixir Markdown rendering library allows a remote unauthenticated attacker to exhaust host memory and crash the BEAM virtual machine by submitting a single crafted fenced code block with an oversized highlight_lines range. Any application that renders user-supplied Markdown through MDEx.to_html/2 - such as a comment box, chat message, or wiki page - is exposed; a payload differing by only a few bytes can force hundreds of megabytes to gigabytes of allocation. No public exploit has been identified at time of analysis, though the attack payload is trivially constructable directly from the public advisory, and patched versions 0.12.3 (mdex) and 0.2.3 (mdex_native) are available.

RemediationAI

Upgrade mdex to version 0.12.3 or later and mdex_native to version 0.2.3 or later; the upstream fix is available in commit 798a363b4339f6f7162ec8437c4c9f9b5ae6fbf3 at https://github.com/leandrocp/mdex_native/commit/798a363b4339f6f7162ec8437c4c9f9b5ae6fbf3. If immediate patching is not feasible, the most targeted compensating control is to sanitize the fenced code block info string at the application layer before passing Markdown to MDEx - specifically, strip or reject the highlight_lines parameter, or cap the range bounds to a safe maximum (e.g., no range endpoint exceeding 10,000) before calling MDEx.to_html/2; this adds application-layer parsing complexity but avoids the native allocation entirely. Alternatively, restricting the Markdown rendering feature to authenticated or trusted users eliminates anonymous exploitation but may not suit comment or community platforms. Running the BEAM in a containerized environment with strict memory limits (via Linux cgroups or Kubernetes resource limits) reduces blast radius from a full host outage to a single container restart, but does not prevent denial of service for affected users. Advisory details are at https://github.com/leandrocp/mdex_native/security/advisories/GHSA-j93q-9cvj-rxfm.

Affected VersionsENISA

mdex 0.11.0 <0.12.3
mdex a8407611715d1ead35fbcba79c72cef1b7df387b <6ed94d905f97af188323f042698ae841c02293b4
mdex_native 956528c5e31746253347029e810a969ab916fd27 <798a363b4339f6f7162ec8437c4c9f9b5ae6fbf3
mdex_native 0.1.0 <0.2.3

Affected Packages

euvd mdex fix: 0.12.3
euvd mdex_native fix: 0.2.3

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 is an Elixir library that wraps Rust-based Markdown parsing via a Native Implemented Function (NIF), binding to the comrak Markdown parser. The vulnerable function comrak_nif::lumis_adapter::LumisAdapter::parse_highlight_lines in native/comrak_nif/src/lumis_adapter.rs processes the highlight_lines info string on fenced code blocks - a CommonMark extension allowing specific lines to be highlighted. The function materializes the entire user-specified inclusive integer range (e.g., 1-2000000000) into a Vec<usize>, pushing one 8-byte element per integer with no upper-bound cap. This constitutes CWE-789 (Memory Allocation with Excessive Size Value): the allocation size is derived directly from attacker-controlled input without validation. A secondary O(n²) degradation exists because membership tests against the populated vector use a linear scan rather than a set structure, meaning even non-memory-exhausting ranges cause quadratic CPU cost. The same vulnerable code was later extracted into the separate mdex_native package at native/mdex_native_nif/src/lumis_adapter.rs, where it remained unpatched until version 0.2.3. Both CPEs cpe:2.3:a:leandrocp:mdex and cpe:2.3:a:leandrocp:mdex_native are confirmed affected.

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

Vendor (EEF) PRIMARY 6.9 MEDIUM
CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:H
vuln.today AI 8.6 HIGH

Attack is delivered over the network via submitted Markdown; no auth or interaction needed; BEAM crash terminates all co-tenant sessions, constituting a scope change beyond the library component.

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

Primary rating from Vendor (EEF).

CVSS VectorVendor: EEF

Attack Vector
Local
Attack Complexity
Low
Attack Requirements
Present
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
None
Vulnerable system: Integrity
None
Vulnerable system: Availability
High
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
High

DescriptionCVE.org

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.

Threat Intelligence Overview

EPSS Score
0.1%
Top 96% exploitable
Prevalence
Low
niche Elixir-ecosystem Markdown rendering library, limited enterprise footprint
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GitHub VulDB

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.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.1%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Defer
Exploitation
None
System Exposure· derived
Small
Automatable
No
Human Impact· derived
Medium
Technical Impact
Partial

Priority Score

34
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +34
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

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