{"api_version":"1","generated_at":"2026-12-01T14:13:22+00:00","cve":"CVE-2026-137162","urls":{"html":"https://cve.report/CVE-2026-137162","api":"https://cve.report/api/cve/CVE-2026-137162.json","docs":"https://cve.report/api","cve_org":"https://www.cve.org/CVERecord?id=CVE-2026-137162","nvd":"https://nvd.nist.gov/vuln/detail/CVE-2026-137162"},"summary":{"title":"Quadratic CPU consumption in mdex auto-close block quote prefix expansion","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.\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.","state":"PUBLISHED","assigner":"EEF","published_at":"2026-11-30 19:17:55","updated_at":"2026-11-30 19:17:55"},"problem_types":["CWE-407","CWE-407 CWE-407 Inefficient Algorithmic Complexity"],"metrics":[{"version":"4.0","source":"6b3ad84c-e1a6-4bf7-a703-f496b71e49db","type":"Secondary","score":"2.1","severity":"LOW","vector":"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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","data":{"version":"4.0","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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","baseScore":2.1,"baseSeverity":"LOW","attackVector":"LOCAL","attackComplexity":"LOW","attackRequirements":"PRESENT","privilegesRequired":"NONE","userInteraction":"NONE","vulnConfidentialityImpact":"NONE","vulnIntegrityImpact":"NONE","vulnAvailabilityImpact":"LOW","subConfidentialityImpact":"NONE","subIntegrityImpact":"NONE","subAvailabilityImpact":"NONE","exploitMaturity":"NOT_DEFINED","confidentialityRequirement":"NOT_DEFINED","integrityRequirement":"NOT_DEFINED","availabilityRequirement":"NOT_DEFINED","modifiedAttackVector":"NOT_DEFINED","modifiedAttackComplexity":"NOT_DEFINED","modifiedAttackRequirements":"NOT_DEFINED","modifiedPrivilegesRequired":"NOT_DEFINED","modifiedUserInteraction":"NOT_DEFINED","modifiedVulnConfidentialityImpact":"NOT_DEFINED","modifiedVulnIntegrityImpact":"NOT_DEFINED","modifiedVulnAvailabilityImpact":"NOT_DEFINED","modifiedSubConfidentialityImpact":"NOT_DEFINED","modifiedSubIntegrityImpact":"NOT_DEFINED","modifiedSubAvailabilityImpact":"NOT_DEFINED","Safety":"NOT_DEFINED","Automatable":"NOT_DEFINED","Recovery":"NOT_DEFINED","valueDensity":"NOT_DEFINED","vulnerabilityResponseEffort":"NOT_DEFINED","providerUrgency":"NOT_DEFINED"}},{"version":"4.0","source":"CNA","type":"CVSS","score":"2.1","severity":"LOW","vector":"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","data":{"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"}}],"references":[{"url":"https://cna.erlef.org/cves/CVE-2026-137162.html","name":"https://cna.erlef.org/cves/CVE-2026-137162.html","refsource":"6b3ad84c-e1a6-4bf7-a703-f496b71e49db","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://osv.dev/vulnerability/EEF-CVE-2026-137162","name":"https://osv.dev/vulnerability/EEF-CVE-2026-137162","refsource":"6b3ad84c-e1a6-4bf7-a703-f496b71e49db","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://github.com/leandrocp/mdex/commit/2c29b28cd0473c24347aa00b95d16f9ce5f9d9af","name":"https://github.com/leandrocp/mdex/commit/2c29b28cd0473c24347aa00b95d16f9ce5f9d9af","refsource":"6b3ad84c-e1a6-4bf7-a703-f496b71e49db","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://github.com/leandrocp/mdex/commit/9a4b76802bfcd12ba34337bf3cf7d62621d0fe92","name":"https://github.com/leandrocp/mdex/commit/9a4b76802bfcd12ba34337bf3cf7d62621d0fe92","refsource":"6b3ad84c-e1a6-4bf7-a703-f496b71e49db","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://www.cve.org/CVERecord?id=CVE-2026-137162","name":"CVE Program record","refsource":"CVE.ORG","tags":["canonical"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-137162","name":"NVD vulnerability detail","refsource":"NVD","tags":["canonical","analysis"]}],"affected":[{"source":"CNA","vendor":"leandrocp","product":"mdex","version":"affected 0.14.2 0.15.0 semver","platforms":[]},{"source":"CNA","vendor":"leandrocp","product":"mdex","version":"affected 9a4b76802bfcd12ba34337bf3cf7d62621d0fe92 2c29b28cd0473c24347aa00b95d16f9ce5f9d9af git","platforms":[]}],"timeline":[],"solutions":[],"workarounds":[],"exploits":[],"credits":[{"source":"CNA","value":"Peter Ullrich","lang":"en"},{"source":"CNA","value":"Peter Ullrich","lang":"en"},{"source":"CNA","value":"Jonatan Männchen / EEF","lang":"en"},{"source":"CNA","value":"Leandro Pereira","lang":"en"}],"nvd_cpes":[],"vendor_comments":[],"enrichments":{"kev":null,"epss":null,"legacy_qids":[]},"source_records":{"cve_program":{"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":{"dateUpdated":"2026-11-30T18:43:23.753Z","orgId":"6b3ad84c-e1a6-4bf7-a703-f496b71e49db","shortName":"EEF"},"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."}]}},"cveMetadata":{"assignerOrgId":"6b3ad84c-e1a6-4bf7-a703-f496b71e49db","assignerShortName":"EEF","cveId":"CVE-2026-137162","datePublished":"2026-11-30T18:43:23.753Z","dateReserved":"2026-11-30T06:43:22.951Z","dateUpdated":"2026-11-30T18:43:23.753Z","state":"PUBLISHED"},"dataType":"CVE_RECORD","dataVersion":"5.2"},"nvd":{"publishedDate":"2026-11-30 19:17:55","lastModifiedDate":"2026-11-30 19:17:55","problem_types":["CWE-407","CWE-407 CWE-407 Inefficient Algorithmic Complexity"],"metrics":{"cvssMetricV40":[{"source":"6b3ad84c-e1a6-4bf7-a703-f496b71e49db","type":"Secondary","cvssData":{"version":"4.0","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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","baseScore":2.1,"baseSeverity":"LOW","attackVector":"LOCAL","attackComplexity":"LOW","attackRequirements":"PRESENT","privilegesRequired":"NONE","userInteraction":"NONE","vulnConfidentialityImpact":"NONE","vulnIntegrityImpact":"NONE","vulnAvailabilityImpact":"LOW","subConfidentialityImpact":"NONE","subIntegrityImpact":"NONE","subAvailabilityImpact":"NONE","exploitMaturity":"NOT_DEFINED","confidentialityRequirement":"NOT_DEFINED","integrityRequirement":"NOT_DEFINED","availabilityRequirement":"NOT_DEFINED","modifiedAttackVector":"NOT_DEFINED","modifiedAttackComplexity":"NOT_DEFINED","modifiedAttackRequirements":"NOT_DEFINED","modifiedPrivilegesRequired":"NOT_DEFINED","modifiedUserInteraction":"NOT_DEFINED","modifiedVulnConfidentialityImpact":"NOT_DEFINED","modifiedVulnIntegrityImpact":"NOT_DEFINED","modifiedVulnAvailabilityImpact":"NOT_DEFINED","modifiedSubConfidentialityImpact":"NOT_DEFINED","modifiedSubIntegrityImpact":"NOT_DEFINED","modifiedSubAvailabilityImpact":"NOT_DEFINED","Safety":"NOT_DEFINED","Automatable":"NOT_DEFINED","Recovery":"NOT_DEFINED","valueDensity":"NOT_DEFINED","vulnerabilityResponseEffort":"NOT_DEFINED","providerUrgency":"NOT_DEFINED"}}]},"configurations":[]},"legacy_mitre":{"record":{"CveYear":"2026","CveId":"137162","Ordinal":"1","Title":"Quadratic CPU consumption in mdex auto-close block quote prefix ","CVE":"CVE-2026-137162","Year":"2026"},"notes":[{"CveYear":"2026","CveId":"137162","Ordinal":"1","NoteData":"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.","Type":"Description","Title":"Quadratic CPU consumption in mdex auto-close block quote prefix "}]}}}