{"id":"CVE-2026-137162","summary":"Quadratic CPU consumption in mdex auto-close block quote prefix expansion","details":"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 \u003e, 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 \u003e, 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 \u003e 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.","aliases":["EEF-CVE-2026-137162"],"modified":"2026-11-30T20:00:21.088579229Z","published":"2026-11-30T18:43:23.753Z","database_specific":{"cwe_ids":["CWE-407"],"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/137xxx/CVE-2026-137162.json","unresolved_ranges":[{"extracted_events":[{"range":[{"introduced":"0.14.2"},{"fixed":"0.15.0"}],"source":"AFFECTED_FIELD","strategy":"StandardRange"}]}],"cna_assigner":"EEF"},"references":[{"type":"ADVISORY","url":"https://cna.erlef.org/cves/CVE-2026-137162.html"},{"type":"WEB","url":"https://github.com"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/137xxx/CVE-2026-137162.json"},{"type":"PACKAGE","url":"https://github.com/leandrocp/mdex"},{"type":"FIX","url":"https://github.com/leandrocp/mdex/commit/2c29b28cd0473c24347aa00b95d16f9ce5f9d9af"},{"type":"FIX","url":"https://github.com/leandrocp/mdex/commit/9a4b76802bfcd12ba34337bf3cf7d62621d0fe92"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-137162"},{"type":"WEB","url":"https://osv.dev/vulnerability/EEF-CVE-2026-137162"},{"type":"WEB","url":"https://repo.hex.pm"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://github.com/leandrocp/mdex","events":[{"introduced":"9a4b76802bfcd12ba34337bf3cf7d62621d0fe92"},{"fixed":"2c29b28cd0473c24347aa00b95d16f9ce5f9d9af"},{"fixed":"9a4b76802bfcd12ba34337bf3cf7d62621d0fe92"}],"database_specific":{"extracted_events":[{"strategy":"StandardRange","range":[{"introduced":"9a4b76802bfcd12ba34337bf3cf7d62621d0fe92"},{"fixed":"2c29b28cd0473c24347aa00b95d16f9ce5f9d9af"}],"source":"AFFECTED_FIELD"},{"source":"REFERENCES_COMMIT","range":[{"fixed":"9a4b76802bfcd12ba34337bf3cf7d62621d0fe92"}]},{"range":[{"fixed":"2c29b28cd0473c24347aa00b95d16f9ce5f9d9af"}],"source":"REFERENCES_COMMIT"}]}}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-137162.json"}}],"schema_version":"1.9.2","severity":[{"type":"CVSS_V4","score":"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"}]}