CVE-2026-134916
JSON

6.9medium

Quadratic CPU consumption in MDEx Quill Delta conversion of nested block quotes

Severity
6.9medium CVSS:4.0 by EEF
Exploit likelihood
0.25% (higher than 17% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
EEF
Also known as
EEF-CVE-2026-134916

Description

Inefficient Algorithmic Complexity vulnerability in leandrocp mdex allows an attacker who controls Markdown input to cause a denial of service through CPU exhaustion via deeply nested block quotes passed to MDEx.to_delta/2. When converting a document to a Quill Delta, MDEx.DeltaConverter.default_convert_node/3 in lib/mdex/delta_converter.ex calls apply_block_format/2 for every MDEx.BlockQuote and MDEx.Alert node, and that function rewrites every op produced by the node's descendants. Conversion therefore costs the nesting depth times the number of ops inside, and the parser places no limit on block quote depth. A document of a few hundred kilobytes keeps a scheduler busy for minutes, while parsing and HTML rendering of the same input finish in milliseconds. The parse_time budget bounds only the native parse, not the conversion. This issue affects mdex: from 0.8.3 before 0.15.0.

Affected

Product or packageVersionsReported by
mdexfrom 0.8.3 before 0.15.0CVE List
leandrocp/mdexfrom 9852db2456fdc9d856eb636603a7f608e22e3793 before 75e735a26859f93c36f10d17a3119f856fe69009CVE List
mdex (Hex)from 0.8.3 before 0.15.0Erlang Ecosystem Foundation
https://github.com/leandrocp/mdexfrom 9852db2456fdc9d856eb636603a7f608e22e3793 before 75e735a26859f93c36f10d17a3119f856fe69009Erlang Ecosystem Foundation

All scores

EEF6.9medium CVSS:4.0CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
Erlang Ecosystem FoundationNot scored CVSS:4.0CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N

Classification

What each source says

CVE List

Inefficient Algorithmic Complexity vulnerability in leandrocp mdex allows an attacker who controls Markdown input to cause a denial of service through CPU exhaustion via deeply nested block quotes passed to MDEx.to_delta/2. When converting a document to a Quill Delta, MDEx.DeltaConverter.default_convert_node/3 in lib/mdex/delta_converter.ex calls apply_block_format/2 for every MDEx.BlockQuote and MDEx.Alert node, and that function rewrites every op produced by the node's descendants. Conversion therefore costs the nesting depth times the number of ops inside, and the parser places no limit on block quote depth. A document of a few hundred kilobytes keeps a scheduler busy for minutes, while parsing and HTML rendering of the same input finish in milliseconds. The parse_time budget bounds only the native parse, not the conversion. This issue affects mdex: from 0.8.3 before 0.15.0.

Erlang Ecosystem Foundation

Summary

Inefficient Algorithmic Complexity vulnerability in leandrocp mdex allows an attacker who controls Markdown input to cause a denial of service through CPU exhaustion via deeply nested block quotes passed to MDEx.to_delta/2.

When converting a document to a Quill Delta, MDEx.DeltaConverter.default_convert_node/3 in lib/mdex/delta_converter.ex calls apply_block_format/2 for every MDEx.BlockQuote and MDEx.Alert node, and that function rewrites every op produced by the node's descendants. Conversion therefore costs the nesting depth times the number of ops inside, and the parser places no limit on block quote depth. A document of a few hundred kilobytes keeps a scheduler busy for minutes, while parsing and HTML rendering of the same input finish in milliseconds. The parse_time budget bounds only the native parse, not the conversion.

This issue affects mdex: from 0.8.3 before 0.15.0.

Details

1. Input. Comrak sets no limit on block quote depth, so a line of d > characters followed by n lazy-continuation lines produces d nested MDEx.BlockQuote nodes holding about 2n ops, in only d+2n bytes.

2. Conversion. MDEx.DeltaConverter.default_convert_node/3 converts each block quote's children first and then calls apply_block_format/2, which maps over every descendant op to add the blockquote attribute to newline ops. MDEx.Alert does the same with its alert attributes. Each nesting level walks and rebuilds the whole op list again, so total work is O(d·n).

3. Effect. Measured on 0.14.7, depth 2,000 with 20,000 lines (42 KB) takes 1.9 s, depth 5,000 with 50,000 lines (105 KB) takes 15 s, and depth 10,000 with 100,000 lines (210 KB) takes 172 s. Parsing and MDEx.to_html/2 stay under about 100 ms for the same inputs. budget: [parse_time: ...] limits only the native parse: with parse_time: 1000 the 105 KB input still spent 12 s in conversion.

Proof of concept

  1. Build a Markdown document of 4,000 > characters, then a and a newline, then 40,000 lines of b (about 84 KB).
  2. Convert it with MDEx.to_delta!(markdown, budget: [parse_time: 1_000]).
  3. Observe that the call takes several seconds (9.4 s on 0.14.9), while MDEx.to_html!/1 on the same input finishes in about 16 ms. Doubling depth and line count roughly quadruples the conversion time.

Impact

An unauthenticated attacker who can submit Markdown to an application that converts it with MDEx.to_delta/2 can occupy BEAM schedulers for minutes per small request, degrading or denying service to every other user of the node while the attack continues.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-134916 changed 2026-11-30CVE Terms of Use
Erlang Ecosystem FoundationEEF-CVE-2026-134916 changed 2026-11-30CC-BY-4.0
NVDCVE-2026-134916 changed 2026-11-30Public domain