Read the docs

Quadratic regular expression scans in MDEx allow CPU denial of service

Priority LOW 8CWE-1333Published · 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-1333.

Summary

MDEx, the Elixir Markdown library from leandrocp, is affected from 0.14.3 before 0.15.0. Its MDEx.FragmentParser.text_label/1 function uses two regular expressions anchored at only one end, so processing time grows with the square of a label line or trailing tilde run (CWE-1333). An attacker who supplies Markdown, such as user content or streamed LLM output, can exhaust CPU with a single render of about 60 KB that takes tens of seconds, but only when the application uses the non-default auto_close: [links: :text] or auto_close: [images: :text] policy.

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

Description from the CNA

Inefficient Regular Expression Complexity vulnerability in leandrocp mdex allows an attacker to exhaust CPU via crafted unterminated link or image labels. When an application completes partial Markdown with the non-default auto_close: [links: :text] or auto_close: [images: :text] policy, MDEx.FragmentParser.text_label/1 in lib/mdex/fragment_parser.ex escapes the pending label with two regular expressions, \A[^\n]+|[^\n]+\z and ~{3,}\z, that are anchored at one end only. The engine retries the unanchored alternative from every offset, so the cost grows with the square of a label line or trailing tilde run. An attacker who supplies the Markdown, such as user content or streamed LLM output, can make a single render of about 60 KB take tens of seconds of CPU. The default auto_close: true policy is not affected. This issue affects mdex: from 0.14.3 before 0.15.0.

Why it matters now

Exploitation None reported CISA SSVC · not in CISA KEV
Fix Fixed mdex (leandrocp): 0.15.0

SSVC decision points

CISA ADP · SSVC 2.0.3

Exploitation
None
Automatable
No
Technical impact
Partial

The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.

Affected products

VendorProductAffected versionsFixed inStatusSource
leandrocpmdex0.14.3 to before 0.15.00.15.0Patch availableCNA
  • mdex Vendorleandrocp Affected 0.14.3 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 is the first fixed version. The sources list no fixed version for any other product.

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-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

Timeline

  1. 2026-11-30 Threatist record created from CVE-2026-135699
  2. 2026-11-30 CISA SSVC decision points changed
  3. 2026-11-30 Alias added: GHSA-jvxq-w9gj-vr7j

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