# CVE-2026-137162: Quadratic CPU consumption in mdex auto-close block quote prefix expansion

- Severity: Low 2.1 (CVSS:4.0, scored by EEF) `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`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.23%, higher than 15% of CVEs (2026-12-01)
- Published: 2026-11-30T18:43:23.753Z
- Modified: 2026-11-30T19:17:55.303Z
- Also known as: EEF-CVE-2026-137162
- Weaknesses: CWE-407
- Assigned by: 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.

(As written by CVE List.)

## Affected

- mdex: from 0.14.2 before 0.15.0
- leandrocp/mdex: from 9a4b76802bfcd12ba34337bf3cf7d62621d0fe92 before 2c29b28cd0473c24347aa00b95d16f9ce5f9d9af
- mdex (Hex): from 0.14.2 before 0.15.0
- https://github.com/leandrocp/mdex: from 9a4b76802bfcd12ba34337bf3cf7d62621d0fe92 before 2c29b28cd0473c24347aa00b95d16f9ce5f9d9af

## Every score

- EEF: CVSS:4.0 2.1 Low `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`
- Erlang Ecosystem Foundation: CVSS:4.0 `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`

## References

- <https://cna.erlef.org/cves/CVE-2026-137162.html> (related, third-party-advisory, web)
- <https://osv.dev/vulnerability/EEF-CVE-2026-137162> (related)
- <https://github.com/leandrocp/mdex/commit/9a4b76802bfcd12ba34337bf3cf7d62621d0fe92> (related, web)
- <https://github.com/leandrocp/mdex/commit/2c29b28cd0473c24347aa00b95d16f9ce5f9d9af> (fix, patch)
- <https://hex.pm/packages/mdex> (package)

## Sources

- CVE List: [CVE-2026-137162](https://www.cve.org/CVERecord?id=CVE-2026-137162), CVE Terms of Use, modified 2026-11-30
- Erlang Ecosystem Foundation: [EEF-CVE-2026-137162](https://osv.dev/vulnerability/EEF-CVE-2026-137162), CC-BY-4.0, modified 2026-11-30
- NVD: [CVE-2026-137162](https://nvd.nist.gov/vuln/detail/CVE-2026-137162), Public domain, modified 2026-11-30

---

Page: https://cve.day/CVE-2026-137162 · Whole record: https://cve.day/CVE-2026-137162.json · Rebuilt by cve.day 2026-11-30T19:32:19.273Z
