Read the docs

Quadratic CPU consumption in mdex auto-close block quote handling

Priority LOW 26CWE-407Published · Updated

Key facts

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

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

Summary

Inefficient algorithmic complexity in leandrocp mdex from 0.14.2 before 0.15.0 lets an attacker who supplies Markdown exhaust CPU when auto-close is enabled. The fragment parser recursively expands a long run of block quote markers in a line, which costs quadratic time in the length of that run (CWE-407). An attacker who can submit Markdown can tie up a scheduler for seconds with a single long line, while the same input renders quickly with auto-close off.

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 supplies Markdown to exhaust CPU via a long run of block quote markers when auto-close is enabled. When Markdown is rendered with auto_close: true or through MDEx.stream/2, MDEx.FragmentParser checks whether the last paragraph ends in an incomplete link reference definition. If that paragraph contains >, each line's leading quote prefix is expanded by expand_quote_prefix/2 in lib/mdex/fragment_parser.ex. That function is body-recursive and prepends each character to the prefix built so far, copying it again for every leading space, tab or >, so a line of N such bytes costs O(N²). The prefix length is not bounded. A single line of a few hundred kilobytes of > ties up a scheduler for seconds, while the same input renders in milliseconds with auto-close off. This issue affects mdex: from 0.14.2 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.2 to before 0.15.00.15.0Patch availableCNA
  • mdex Vendorleandrocp Affected 0.14.2 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 version 0.15.0, which fixes the issue.

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-101148 Quadratic HTML tag tracking in MDEx.stream/2 allows CPU exhaustionPriority MEDIUM 46
    • TI-2026-101154 Code block fence breakout in MDEx injects Slack mentions and linksPriority LOW 38
  • Release ·

    leandrocp mdex 2c29b28cd0473c24347aa00b95d16f9ce5f9d9af

    5 records Highest priority Priority MEDIUM 1 MEDIUM, 4 LOW

    Other records, highest priority first

    • TI-2026-101148 Quadratic HTML tag tracking in MDEx.stream/2 allows CPU exhaustionPriority MEDIUM 46
    • 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-137162
  2. 2026-11-30 Alias added: GHSA-755x-fx63-g6rx

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-101148 Quadratic HTML tag tracking in MDEx.stream/2 allows CPU exhaustion CVSS 4.0MEDIUM 6.9
  • TI-2026-101154 Code block fence breakout in MDEx injects Slack mentions and links CVSS 4.0MEDIUM 5.1
See all 15 →

Sources