CVE-2026-137162
published low CVSS 4.0 · 2.1Quadratic CPU consumption in mdex auto-close block quote prefix expansion
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| leandrocp | — | mdex0.14.2 to < 0.15.0 · Other versions: unaffected | Affected | Not stated | EEF |
| leandrocp | — | leandrocp/mdexmdex · 9a4b76802bfcd12ba34337bf3cf7d62621d0fe92 to < 2c29b28cd0473c24347aa00b95d16f9ce5f9d9af · Other versions: unaffected | Affected | Not stated | EEF |
Description
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.
Related advisories
Vendor advisories explicitly linked to this CVE.
No linked advisories were found for this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 4.0
- Base score
- 2.1 / 10
- Severity
- low
- Provider
- EEF · cna
- Vector string
- CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N
- Scenarios
- en: GENERAL
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| leandrocp | mdex | 0.14.2 to < 0.15.0 (affected · semver)Default: unaffected | EEF · cna |
| leandrocp | mdex | 9a4b76802bfcd12ba34337bf3cf7d62621d0fe92 to < 2c29b28cd0473c24347aa00b95d16f9ce5f9d9af (affected · git)Default: unaffected | EEF · cna |
Weaknesses
1- CWE-407 CWE-407 Inefficient Algorithmic Complexity
References
4- EEF CNA record for CVE-2026-137162 https://cna.erlef.org/cves/CVE-2026-137162.html
- Fix commit 2c29b28 in leandrocp/mdex https://github.com/leandrocp/mdex/commit/2c29b28cd0473c24347aa00b95d16f9ce5f9d9af
- Introducing commit 9a4b768 in leandrocp/mdex https://github.com/leandrocp/mdex/commit/9a4b76802bfcd12ba34337bf3cf7d62621d0fe92
- OSV record EEF-CVE-2026-137162 https://osv.dev/vulnerability/EEF-CVE-2026-137162
Provider assertions
1EEF · cna
Quadratic CPU consumption in mdex auto-close block quote prefix expansion
Provenance
- Schema
- 5.2
- Searchable
- yes
- Content hash
- 135dbd4931847ee829c72a834d2a0e6ccd6ca3b95df5c62f798a936f324a8fd0
- Ingested
- 30 Nov 2026, 18:59:00 UTC
- Source record
- Official CVE record