{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-135699","assignerOrgId":"6b3ad84c-e1a6-4bf7-a703-f496b71e49db","state":"PUBLISHED","assignerShortName":"EEF","dateReserved":"2026-11-30T16:55:44.953Z","datePublished":"2026-11-30T18:44:21.528Z","dateUpdated":"2026-11-30T19:01:59.731Z"},"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':text_label/1"},{"name":"'Elixir.MDEx.FragmentParser':pending_link/3"},{"name":"'Elixir.MDEx.FragmentParser':complete/2"},{"name":"'Elixir.MDEx.FragmentParser':complete_with_state/3"}],"repo":"https://github.com/leandrocp/mdex","vendor":"leandrocp","versions":[{"lessThan":"0.15.0","status":"affected","version":"0.14.3","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':text_label/1"},{"name":"'Elixir.MDEx.FragmentParser':pending_link/3"},{"name":"'Elixir.MDEx.FragmentParser':complete/2"},{"name":"'Elixir.MDEx.FragmentParser':complete_with_state/3"}],"repo":"https://github.com/leandrocp/mdex","vendor":"leandrocp","versions":[{"lessThan":"2c29b28cd0473c24347aa00b95d16f9ce5f9d9af","status":"affected","version":"359d46b344042a2feda7c768051d39b9d460b210","versionType":"git"}]}],"configurations":[{"lang":"en","supportingMedia":[{"base64":false,"type":"text/html","value":"<p>The application must render or complete attacker-influenced Markdown with the <code>:text</code> completion policy for links or images, <code>auto_close: [links: :text]</code> or <code>auto_close: [images: :text]</code>. The default <code>auto_close: true</code> policy and rendering without <code>auto_close</code> are not affected.</p>"},{"base64":false,"type":"text/markdown","value":"The application must render or complete attacker-influenced Markdown with the `:text` completion policy for links or images, `auto_close: [links: :text]` or `auto_close: [images: :text]`. The default `auto_close: true` policy and rendering without `auto_close` are not affected."}],"value":"The application must render or complete attacker-influenced Markdown with the :text completion policy for links or images, auto_close: [links: :text] or auto_close: [images: :text]. The default auto_close: true policy and rendering without auto_close are not affected."}],"cpeApplicability":[{"nodes":[{"cpeMatch":[{"criteria":"cpe:2.3:a:leandrocp:mdex:*:*:*:*:*:*:*:*","versionEndExcluding":"0.15.0","versionStartIncluding":"0.14.3","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:55:55.000Z","datePublic":"2026-11-30T18:44:20.000Z","descriptions":[{"lang":"en","supportingMedia":[{"base64":false,"type":"text/html","value":"<p>Inefficient Regular Expression Complexity vulnerability in leandrocp mdex allows an attacker to exhaust CPU via crafted unterminated link or image labels.</p>\n<p>When an application completes partial Markdown with the non-default <code>auto_close: [links: :text]</code> or <code>auto_close: [images: :text]</code> policy, <code>MDEx.FragmentParser.text_label/1</code> in <code>lib/mdex/fragment_parser.ex</code> escapes the pending label with two regular expressions, <code>\\A[^\\n]+|[^\\n]+\\z</code> and <code>~{3,}\\z</code>, that are anchored at one end only. The engine retries the unanchored alternative from every offset, so the cost grows with the square of a label line or trailing tilde run. An attacker who supplies the Markdown, such as user content or streamed LLM output, can make a single render of about 60 KB take tens of seconds of CPU. The default <code>auto_close: true</code> policy is not affected.</p>\n<p>This issue affects mdex: from 0.14.3 before 0.15.0.</p>"},{"base64":false,"type":"text/markdown","value":"Inefficient Regular Expression Complexity vulnerability in leandrocp mdex allows an attacker to exhaust CPU via crafted unterminated link or image labels.\n\nWhen an application completes partial Markdown with the non-default `auto_close: [links: :text]` or `auto_close: [images: :text]` policy, `MDEx.FragmentParser.text_label/1` in `lib/mdex/fragment_parser.ex` escapes the pending label with two regular expressions, `\\A[^\\n]+|[^\\n]+\\z` and `~{3,}\\z`, that are anchored at one end only. The engine retries the unanchored alternative from every offset, so the cost grows with the square of a label line or trailing tilde run. An attacker who supplies the Markdown, such as user content or streamed LLM output, can make a single render of about 60 KB take tens of seconds of CPU. The default `auto_close: true` policy is not affected.\n\nThis issue affects mdex: from 0.14.3 before 0.15.0."}],"value":"Inefficient Regular Expression Complexity vulnerability in leandrocp mdex allows an attacker to exhaust CPU via crafted unterminated link or image labels.\n\nWhen an application completes partial Markdown with the non-default auto_close: [links: :text] or auto_close: [images: :text] policy, MDEx.FragmentParser.text_label/1 in lib/mdex/fragment_parser.ex escapes the pending label with two regular expressions, \\A[^\\n]+|[^\\n]+\\z and ~{3,}\\z, that are anchored at one end only. The engine retries the unanchored alternative from every offset, so the cost grows with the square of a label line or trailing tilde run. An attacker who supplies the Markdown, such as user content or streamed LLM output, can make a single render of about 60 KB take tens of seconds of CPU. The default auto_close: true policy is not affected.\n\nThis issue affects mdex: from 0.14.3 before 0.15.0."}],"impacts":[{"capecId":"CAPEC-492","descriptions":[{"lang":"en","supportingMedia":[{"base64":false,"type":"text/html","value":"<p>An attacker who controls Markdown rendered with the <code>:text</code> auto-close policy can make each render consume seconds of CPU, slowing or stalling the application under repeated requests.</p>"},{"base64":false,"type":"text/markdown","value":"An attacker who controls Markdown rendered with the `:text` auto-close policy can make each render consume seconds of CPU, slowing or stalling the application under repeated requests."}],"value":"An attacker who controls Markdown rendered with the :text auto-close policy can make each render consume seconds of CPU, slowing or stalling the application under repeated requests."}]}],"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-1333","description":"CWE-1333 Inefficient Regular Expression Complexity","lang":"en","type":"CWE"}]}],"providerMetadata":{"orgId":"6b3ad84c-e1a6-4bf7-a703-f496b71e49db","shortName":"EEF","dateUpdated":"2026-11-30T18:44:21.528Z"},"references":[{"name":"EEF CNA record for CVE-2026-135699","tags":["related","third-party-advisory"],"url":"https://cna.erlef.org/cves/CVE-2026-135699.html"},{"name":"OSV record EEF-CVE-2026-135699","tags":["related"],"url":"https://osv.dev/vulnerability/EEF-CVE-2026-135699"},{"name":"Introducing commit 359d46b in leandrocp/mdex","tags":["related"],"url":"https://github.com/leandrocp/mdex/commit/359d46b344042a2feda7c768051d39b9d460b210"},{"name":"Fix commit 2c29b28 in leandrocp/mdex","tags":["patch"],"url":"https://github.com/leandrocp/mdex/commit/2c29b28cd0473c24347aa00b95d16f9ce5f9d9af"}],"source":{"discovery":"INTERNAL"},"title":"Quadratic regular expression scans in MDEx auto_close text policy allow CPU denial of service","x_proofOfConcept":[{"lang":"en","supportingMedia":[{"base64":false,"type":"text/html","value":"<ol>\n<li>Use an application that renders untrusted Markdown with <code>auto_close: [links: :text]</code>.</li>\n<li>Submit a fragment made of <code>[a</code>, a newline, 60 000 <code>x</code> characters, a newline, and <code>b](htt</code>, leaving the link unterminated.</li>\n<li>Render it with <code>MDEx.to_html!/2</code> and those options. The call takes tens of seconds of CPU, while the same input with <code>auto_close: true</code> renders in milliseconds.</li>\n<li>Alternatively, submit <code>[~~~ </code> followed by 40 000 <code>~</code> characters and <code>x](htt</code> to drive the trailing-tilde regex.</li>\n</ol>"},{"base64":false,"type":"text/markdown","value":"1. Use an application that renders untrusted Markdown with `auto_close: [links: :text]`.\n2. Submit a fragment made of `[a`, a newline, 60 000 `x` characters, a newline, and `b](htt`, leaving the link unterminated.\n3. Render it with `MDEx.to_html!/2` and those options. The call takes tens of seconds of CPU, while the same input with `auto_close: true` renders in milliseconds.\n4. Alternatively, submit `[~~~ ` followed by 40 000 `~` characters and `x](htt` to drive the trailing-tilde regex."}],"value":"* Use an application that renders untrusted Markdown with auto_close: [links: :text].\n* Submit a fragment made of [a, a newline, 60 000 x characters, a newline, and b](htt, leaving the link unterminated.\n* Render it with MDEx.to_html!/2 and those options. The call takes tens of seconds of CPU, while the same input with auto_close: true renders in milliseconds.\n* Alternatively, submit [~~~  followed by 40 000 ~ characters and x](htt to drive the trailing-tilde regex."}],"x_technicalAnalysis":[{"lang":"en","supportingMedia":[{"base64":false,"type":"text/html","value":"<p><strong>1. Reaching the label.</strong> <code>MDEx.FragmentParser.complete/2</code> (also reached through <code>MDEx.to_html/2</code> and the streaming document when <code>auto_close</code> is set) closes an unterminated link or image. Under the <code>:text</code> policy, <code>pending_link/3</code> and <code>complete_label/3</code> hand the attacker's label to <code>text_label/1</code>. The destination branch of <code>complete_link/4</code> lets the label span several lines, for example <code>[a</code>, a long middle line, then <code>b](htt</code>.</p>\n<p><strong>2. Quadratic matching.</strong> <code>text_label/1</code> runs <code>Regex.replace</code> with <code>\\A[^\\n]+|[^\\n]+\\z</code>. On a middle line the first alternative cannot match and the second consumes the whole line before failing at <code>\\z</code>, and the engine repeats this from every later offset, so a line of N bytes costs about N squared steps. The trailing-tilde pass <code>~{3,}\\z</code> behaves the same way on a long run of tildes.</p>\n<p><strong>3. Effect.</strong> One render occupies a scheduler for seconds: a 60 KB label took about 23 s on mdex 0.14.9, against about 11 ms with the default policy, and quadrupling the input raised the time about 18 times.</p>"},{"base64":false,"type":"text/markdown","value":"**1. Reaching the label.** `MDEx.FragmentParser.complete/2` (also reached through `MDEx.to_html/2` and the streaming document when `auto_close` is set) closes an unterminated link or image. Under the `:text` policy, `pending_link/3` and `complete_label/3` hand the attacker's label to `text_label/1`. The destination branch of `complete_link/4` lets the label span several lines, for example `[a`, a long middle line, then `b](htt`.\n\n**2. Quadratic matching.** `text_label/1` runs `Regex.replace` with `\\A[^\\n]+|[^\\n]+\\z`. On a middle line the first alternative cannot match and the second consumes the whole line before failing at `\\z`, and the engine repeats this from every later offset, so a line of N bytes costs about N squared steps. The trailing-tilde pass `~{3,}\\z` behaves the same way on a long run of tildes.\n\n**3. Effect.** One render occupies a scheduler for seconds: a 60 KB label took about 23 s on mdex 0.14.9, against about 11 ms with the default policy, and quadrupling the input raised the time about 18 times."}],"value":"1. Reaching the label. MDEx.FragmentParser.complete/2 (also reached through MDEx.to_html/2 and the streaming document when auto_close is set) closes an unterminated link or image. Under the :text policy, pending_link/3 and complete_label/3 hand the attacker's label to text_label/1. The destination branch of complete_link/4 lets the label span several lines, for example [a, a long middle line, then b](htt.\n\n2. Quadratic matching. text_label/1 runs Regex.replace with \\A[^\\n]+|[^\\n]+\\z. On a middle line the first alternative cannot match and the second consumes the whole line before failing at \\z, and the engine repeats this from every later offset, so a line of N bytes costs about N squared steps. The trailing-tilde pass ~{3,}\\z behaves the same way on a long run of tildes.\n\n3. Effect. One render occupies a scheduler for seconds: a 60 KB label took about 23 s on mdex 0.14.9, against about 11 ms with the default policy, and quadrupling the input raised the time about 18 times."}]},"adp":[{"metrics":[{"other":{"type":"ssvc","content":{"timestamp":"2026-11-30T19:01:53.034020Z","id":"CVE-2026-135699","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"partial"}],"role":"CISA Coordinator","version":"2.0.3"}}}],"title":"CISA ADP Vulnrichment","providerMetadata":{"orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","shortName":"CISA-ADP","dateUpdated":"2026-11-30T19:01:59.731Z"}}]}}