CVE-2026-54888: Uncontrolled Recursion in mdex Leads to Denial of Service

mdex Updated 30 Jun 2026

Summary

29/06/2026
Yes i
Medium
6.9

CVE-2026-54888: Uncontrolled recursion over deeply nested Markdown crashes the BEAM in mdex. Affects mdex across 3 version ranges.

>= 0.3.0, < 0.12.3 >= 956528c5e31746253347029e810a969ab916fd27, < 947696c47bc22bea5dffc0f78c946fa6b70ce183 >= d0bc7d55177727c61d188ef465178ab3b81f4f2c, < 6ed94d905f97af188323f042698ae841c02293b4

Fixed in 0.12.3. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

mdex is an Elixir library designed for converting Markdown documents into structured formats and vice versa. It utilizes Comrak's internal Abstract Syntax Tree (AST) for processing Markdown. The library is widely used for rendering Markdown in Elixir applications, making it essential for developers who require Markdown support in their projects. However, a critical vulnerability exists that allows for denial of service through deeply nested Markdown inputs.

Vulnerability Detail

The vulnerability arises from uncontrolled recursion in the mdex library, specifically in the conversion functions ex_document_to_comrak_ast and comrak_ast_to_ex_document. These functions do not enforce a maximum nesting depth, allowing an attacker to craft a Markdown document with excessive nested block quotes. This leads to unbounded recursion, which can exhaust the native C stack and result in a stack overflow. The overflow triggers an uncatchable SIGSEGV signal, causing the BEAM process to terminate and affecting all Elixir and Erlang processes on the node. No special privileges or authentication are required to exploit this vulnerability.

How To Fix

Latest published version: 0.14.2 as of 23 Oct 2026

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

0.12.3

This is the first release that contains the fix.

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, you can validate and sanitize Markdown input to limit nesting depth before processing it with mdex. This can be done by implementing a custom parser that checks for excessive nesting and rejects such inputs.

Conclusion

CVE-2026-54888 is a significant vulnerability in the mdex library that can lead to denial of service through uncontrolled recursion. It is crucial for developers using this library to update to the patched versions to mitigate the risk. Additionally, implementing input validation can serve as a temporary workaround until the update is applied.

See every vulnerability recorded for mdex →

Share this vulnerability

FAQ

CVE-2026-54888 is a vulnerability in the mdex library that allows for denial of service through uncontrolled recursion in Markdown processing.

If your application uses the mdex library, an attacker can exploit this vulnerability to crash the BEAM process, affecting all Elixir and Erlang processes running on the node.

mdex versions from 0.3.0 before 0.12.3 are affected by this vulnerability.

Yes, you can use Vulert, which monitors and alerts in real-time for open-source vulnerabilities. You can check if your application is affected by this vulnerability using the Vulert playground without any signup.

The CVSS score of this vulnerability is 6.9, indicating a moderate severity level.

Related vulnerabilities

Recent vulnerabilities recorded for mdex.

How To Fix

Latest published version: 0.14.2 as of 23 Oct 2026

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

0.12.3

This is the first release that contains the fix.

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback