{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-137162","assignerOrgId":"6b3ad84c-e1a6-4bf7-a703-f496b71e49db","state":"PUBLISHED","assignerShortName":"EEF","dateReserved":"2026-11-30T06:43:22.951Z","datePublished":"2026-11-30T18:43:23.753Z","dateUpdated":"2026-11-30T18:43:23.753Z"},"containers":{"cna":{"affected":[{"collectionURL":"https://repo.hex.pm","cpes":["cpe:2.3:a:leandrocp:mdex:*:*:*:*:*:*:*:*"],"defaultStatus":"unaffected","modules":["'Elixir.MDEx.FragmentParser'"],"packageName":"mdex","packageURL":"pkg:hex/mdex","product":"mdex","programFiles":["lib/mdex/fragment_parser.ex"],"programRoutines":[{"name":"'Elixir.MDEx.FragmentParser':expand_quote_prefix/2"},{"name":"'Elixir.MDEx.FragmentParser':complete/2"}],"repo":"https://github.com/leandrocp/mdex","vendor":"leandrocp","versions":[{"lessThan":"0.15.0","status":"affected","version":"0.14.2","versionType":"semver"}]},{"collectionURL":"https://github.com","cpes":["cpe:2.3:a:leandrocp:mdex:*:*:*:*:*:*:*:*"],"defaultStatus":"unaffected","modules":["'Elixir.MDEx.FragmentParser'"],"packageName":"leandrocp/mdex","packageURL":"pkg:github/leandrocp/mdex","product":"mdex","programFiles":["lib/mdex/fragment_parser.ex"],"programRoutines":[{"name":"'Elixir.MDEx.FragmentParser':expand_quote_prefix/2"},{"name":"'Elixir.MDEx.FragmentParser':complete/2"}],"repo":"https://github.com/leandrocp/mdex","vendor":"leandrocp","versions":[{"lessThan":"2c29b28cd0473c24347aa00b95d16f9ce5f9d9af","status":"affected","version":"9a4b76802bfcd12ba34337bf3cf7d62621d0fe92","versionType":"git"}]}],"cpeApplicability":[{"nodes":[{"cpeMatch":[{"criteria":"cpe:2.3:a:leandrocp:mdex:*:*:*:*:*:*:*:*","versionEndExcluding":"0.15.0","versionStartIncluding":"0.14.2","vulnerable":true}],"negate":false,"operator":"OR"}],"operator":"AND"}],"credits":[{"lang":"en","type":"finder","value":"Peter Ullrich"},{"lang":"en","type":"reporter","value":"Peter Ullrich"},{"lang":"en","type":"analyst","value":"Jonatan Männchen / EEF"},{"lang":"en","type":"remediation developer","value":"Leandro Pereira"}],"dateAssigned":"2026-11-30T16:56:05.000Z","datePublic":"2026-11-30T18:43:22.000Z","descriptions":[{"lang":"en","supportingMedia":[{"base64":false,"type":"text/html","value":"<p>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.</p>\n<p>When Markdown is rendered with <code>auto_close: true</code> or through <code>MDEx.stream/2</code>, <code>MDEx.FragmentParser</code> checks whether the last paragraph ends in an incomplete link reference definition. If that paragraph contains <code>&gt;</code>, each line's leading quote prefix is expanded by <code>expand_quote_prefix/2</code> in <code>lib/mdex/fragment_parser.ex</code>. That function is body-recursive and prepends each character to the prefix built so far, copying it again for every leading space, tab or <code>&gt;</code>, 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 <code>&gt;</code> ties up a scheduler for seconds, while the same input renders in milliseconds with auto-close off.</p>\n<p>This issue affects mdex: from 0.14.2 before 0.15.0.</p>"},{"base64":false,"type":"text/markdown","value":"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.\n\nWhen 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.\n\nThis issue affects mdex: from 0.14.2 before 0.15.0."}],"value":"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.\n\nWhen 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.\n\nThis issue affects mdex: from 0.14.2 before 0.15.0."}],"impacts":[{"capecId":"CAPEC-130","descriptions":[{"lang":"en","supportingMedia":[{"base64":false,"type":"text/html","value":"<p>An attacker who can submit Markdown to an application that auto-closes or streams it can occupy a CPU core for seconds with a single request of a few hundred kilobytes, degrading rendering for other users.</p>"},{"base64":false,"type":"text/markdown","value":"An attacker who can submit Markdown to an application that auto-closes or streams it can occupy a CPU core for seconds with a single request of a few hundred kilobytes, degrading rendering for other users."}],"value":"An attacker who can submit Markdown to an application that auto-closes or streams it can occupy a CPU core for seconds with a single request of a few hundred kilobytes, degrading rendering for other users."}]}],"metrics":[{"cvssV4_0":{"Automatable":"NOT_DEFINED","Recovery":"NOT_DEFINED","Safety":"NOT_DEFINED","attackComplexity":"LOW","attackRequirements":"PRESENT","attackVector":"LOCAL","baseScore":2.1,"baseSeverity":"LOW","privilegesRequired":"NONE","providerUrgency":"NOT_DEFINED","subAvailabilityImpact":"NONE","subConfidentialityImpact":"NONE","subIntegrityImpact":"NONE","userInteraction":"NONE","valueDensity":"NOT_DEFINED","vectorString":"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","version":"4.0","vulnAvailabilityImpact":"LOW","vulnConfidentialityImpact":"NONE","vulnIntegrityImpact":"NONE","vulnerabilityResponseEffort":"NOT_DEFINED"},"format":"CVSS","scenarios":[{"lang":"en","value":"GENERAL"}]}],"problemTypes":[{"descriptions":[{"cweId":"CWE-407","description":"CWE-407 Inefficient Algorithmic Complexity","lang":"en","type":"CWE"}]}],"providerMetadata":{"orgId":"6b3ad84c-e1a6-4bf7-a703-f496b71e49db","shortName":"EEF","dateUpdated":"2026-11-30T18:43:23.753Z"},"references":[{"name":"EEF CNA record for CVE-2026-137162","tags":["related","third-party-advisory"],"url":"https://cna.erlef.org/cves/CVE-2026-137162.html"},{"name":"OSV record EEF-CVE-2026-137162","tags":["related"],"url":"https://osv.dev/vulnerability/EEF-CVE-2026-137162"},{"name":"Introducing commit 9a4b768 in leandrocp/mdex","tags":["related"],"url":"https://github.com/leandrocp/mdex/commit/9a4b76802bfcd12ba34337bf3cf7d62621d0fe92"},{"name":"Fix commit 2c29b28 in leandrocp/mdex","tags":["patch"],"url":"https://github.com/leandrocp/mdex/commit/2c29b28cd0473c24347aa00b95d16f9ce5f9d9af"}],"source":{"discovery":"INTERNAL"},"title":"Quadratic CPU consumption in mdex auto-close block quote prefix expansion","x_proofOfConcept":[{"lang":"en","supportingMedia":[{"base64":false,"type":"text/html","value":"<ol>\n<li>Build a Markdown input consisting of a single line of 400,000 <code>&gt;</code> characters.</li>\n<li>Render it with <code>MDEx.to_html!(input, auto_close: true)</code>, or pass it as one chunk to <code>MDEx.stream/2</code>.</li>\n<li>Observe the call takes over ten seconds, compared with under 150 ms for <code>MDEx.to_html!(input)</code> without auto-close.</li>\n</ol>"},{"base64":false,"type":"text/markdown","value":"1. Build a Markdown input consisting of a single line of 400,000 `>` characters.\n2. Render it with `MDEx.to_html!(input, auto_close: true)`, or pass it as one chunk to `MDEx.stream/2`.\n3. Observe the call takes over ten seconds, compared with under 150 ms for `MDEx.to_html!(input)` without auto-close."}],"value":"* Build a Markdown input consisting of a single line of 400,000 > characters.\n* Render it with MDEx.to_html!(input, auto_close: true), or pass it as one chunk to MDEx.stream/2.\n* Observe the call takes over ten seconds, compared with under 150 ms for MDEx.to_html!(input) without auto-close."}]}}}