Quadratic rescanning in MDEx auto-close link scanner allows CPU denial of service
- State
- Published
- Severity
- 2.1 Low
- Published
- Nov 30, 2026
- Updated
- Nov 30, 2026
- Reserved
- Nov 30, 2026
Description
Inefficient Algorithmic Complexity vulnerability in MDEx.FragmentParser in leandrocp mdex allows an attacker who controls streamed or auto-closed Markdown to cause a denial of service through CPU exhaustion. Any application that renders untrusted Markdown with MDEx.stream/2 or the auto_close option is affected, for example live previews or streamed LLM output.
While auto-closing the last paragraph, close_bracket/5 in lib/mdex/fragment_parser.ex runs an unbounded forward scan of the link tail for every ](. When that scan finds no valid link, scanning resumes just after the ], so the next ]( rescans the same tail. Each closed link also re-filters every pending image opener. Repeated [](x (, [](x(, or ![ openers in one paragraph therefore cost quadratic time, and about 100 KB of input occupies a scheduler for over ten seconds.
This issue affects mdex: from 0.14.2 before 0.15.0.
| Product | Versions |
|---|---|
| mdex leandrocp | 0.14.2 to before 0.15.0 Affected |
| mdex leandrocp | bea359152bc1f63f3256ee86ca207151b815940d to before 2c29b28cd0473c24347aa00b95d16f9ce5f9d9af Affected |
| CVSS | Score | How It's Reached | Source |
|---|---|---|---|
| 4.0 | 2.1 Low | EEF |
Weaknesses
- CWE-407 Inefficient Algorithmic Complexity
References
- EEF CNA record for CVE-2026-129522RelatedThird-Party Advisory
- OSV record EEF-CVE-2026-129522Related
- Introducing commit bea3591 in leandrocp/mdexRelated
- Fix commit 2c29b28 in leandrocp/mdexPatch
Every record here comes from the CVE Program's CVE List. © 1999-2026 The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation. The records are reproduced under the CVE Program terms of use.