Read the docs

Quadratic HTML tag tracking in MDEx.stream/2 allows CPU exhaustion

Priority MEDIUM 46CWE-407Published · Updated

Key facts

Attack vector
Local
Privileges required
None
User interaction
None
Attack complexity
Low
Attack requirements
None
Impact type
Denial of service
Confidentiality · integrity · availability
None · None · High
Fix status
Fixed

Attack profile from CVSS 4.0 · CNA. Fix status from CNA. Impact type from CWE-407.

Summary

Mdex from 0.14.0 before 0.15.0 uses inefficient algorithmic complexity (CWE-407) in MDEx.stream/2 when tracking open HTML tags. An attacker who controls the Markdown passed to MDEx.stream/2 can send an HTML block with many unmatched closing tags, so each closer rescans an unbounded list and exhausts CPU. The tracking runs regardless of the auto_close option and the render unsafe setting, while MDEx.to_html/1 and other non-streaming entry points are not affected.

Written with Claude Haiku 5.5 from the sources below · 2026-12-01

Description from the CNA

Inefficient Algorithmic Complexity vulnerability in leandrocp mdex allows an attacker who controls Markdown passed to MDEx.stream/2 to exhaust CPU via unmatched HTML closing tags. MDEx.stream/2 tracks open HTML tags with MDEx.FragmentParser.continue_html_context/2 in lib/mdex/fragment_parser.ex. Every non-void opening tag is pushed onto an unbounded list, and close_html_tag/2 scans the whole list for each closing tag. A closer with no matching opener leaves the list unchanged, so the next closer scans it again. An HTML block of N openers followed by N unmatched closers therefore costs O(N²), and about 270 KB of input keeps a scheduler busy for tens of seconds. The tracking runs on every HTML block and inline HTML literal regardless of the auto_close option and the render unsafe setting. MDEx.to_html/1 and the other non-streaming entry points are not affected. This issue affects mdex: from 0.14.0 before 0.15.0.

Why it matters now

Fix Fixed mdex (leandrocp): 0.15.0

SSVC decision points

Not available: CISA has not published SSVC decision points for this record.

Affected products

VendorProductAffected versionsFixed inStatusSource
leandrocpmdex0.14.0 to before 0.15.00.15.0Patch availableCNA
  • mdex Vendorleandrocp Affected 0.14.0 to before 0.15.0 Fixed in 0.15.0 Patch available CNA

CPE names CNA · 1

CPEVersionsRoleVendor
cpe:2.3:a:leandrocp:mdex:*:*:*:*:*:*:*:*——leandrocp
  • cpe:2.3:a:leandrocp:mdex:*:*:*:*:*:*:*:* Versions — — ·leandrocp

Remediation

Upgrade mdex to 0.15.0, which fixes the issue. The sources list no fixed version for other products.

Written with Claude Haiku 5.5 from the sources below · 2026-12-01

  • Fix · CNA mdex (leandrocp) Fixed in 0.15.0

Fixed in the same release

Records fixed by the same vendor advisory or release, as the CNA lists them.

  • Release ·

    leandrocp mdex 0.15.0

    10 records Highest priority Priority MEDIUM 2 MEDIUM, 8 LOW

    Other records, highest priority first

    • TI-2026-101149 Quadratic CPU consumption in MDEx Quill Delta conversion of nested block quotesPriority MEDIUM 46
    • TI-2026-101154 Code block fence breakout in MDEx injects Slack mentions and linksPriority LOW 38
    • TI-2026-101147 Cubic-time nested block quote rendering in MDEx enables denial of servicePriority LOW 28
  • Release ·

    leandrocp mdex 2c29b28cd0473c24347aa00b95d16f9ce5f9d9af

    5 records Highest priority Priority MEDIUM 1 MEDIUM, 4 LOW

    Other records, highest priority first

    • TI-2026-101155 Quadratic CPU consumption in mdex auto-close block quote handlingPriority LOW 26
    • TI-2026-101151 Quadratic CPU use in mdex auto-close trimming of parentheses after bare URLsPriority LOW 24
    • TI-2026-101150 Quadratic regular expression scans in MDEx allow CPU denial of servicePriority LOW 8

Timeline

  1. 2026-11-30 Threatist record created from CVE-2026-134915
  2. 2026-11-30 Alias added: GHSA-6843-mw9g-x99r

References

  • TI-2026-39661 Uncontrolled recursion over deeply nested Markdown crashes the BEAM in mdex CVSS 4.0MEDIUM 6.9
  • TI-2026-38511 Unbounded native memory leak in mdex escaped-tag rendering enables unauthenticated denial of service CVSS 4.0MEDIUM 6.9
  • TI-2026-39662 Unsanitized URL schemes in MDEx Quill Delta output allow javascript: injection (XSS) CVSS 4.0MEDIUM 5.1
  • TI-2026-101149 Quadratic CPU consumption in MDEx Quill Delta conversion of nested block quotes CVSS 4.0MEDIUM 6.9
  • TI-2026-101154 Code block fence breakout in MDEx injects Slack mentions and links CVSS 4.0MEDIUM 5.1
  • TI-2026-38508 Atom-table exhaustion denial-of-service via JSON parse_document in MDEx CVSS 4.0HIGH 8.2
See all 15 →

Sources