EEF-CVE-2026-135699

Source
https://cna.erlef.org/osv/EEF-CVE-2026-135699.html
Import Source
https://cna.erlef.org/osv/EEF-CVE-2026-135699.json
JSON Data
https://api.osv.dev/v1/vulns/EEF-CVE-2026-135699
Aliases
  • CVE-2026-135699
Published
2026-11-30T18:44:21Z
Modified
2026-11-30T18:45:05Z
Severity
  • 2.1 (Low) CVSS_V4 - 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 (Source: CNA) CVSS Calculator
Summary
Quadratic regular expression scans in MDEx auto_close text policy allow CPU denial of service
Details

Summary

Inefficient Regular Expression Complexity vulnerability in leandrocp mdex allows an attacker to exhaust CPU via crafted unterminated link or image labels.

When 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.

This issue affects mdex: from 0.14.3 before 0.15.0.

Details

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.

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.

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.

Proof of concept

  1. Use an application that renders untrusted Markdown with auto_close: [links: :text].
  2. Submit a fragment made of [a, a newline, 60 000 x characters, a newline, and b](htt, leaving the link unterminated.
  3. 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.
  4. Alternatively, submit [~~~ followed by 40 000 ~ characters and x](htt to drive the trailing-tilde regex.

Impact

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.

Configurations

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.

Database specific
{
    "$schema":  "https://cna.erlef.org/schemas/osv/record-0.1.0.json",
    "capec_ids":  [
        "CAPEC-492"
    ],
    "cpe_ids":  [
        "cpe:2.3:a:leandrocp:mdex:*:*:*:*:*:*:*:*"
    ],
    "cwe_ids":  [
        "CWE-1333"
    ]
}
References
Credits
    • Peter Ullrich - FINDER
    • Peter Ullrich - REPORTER
    • Jonatan Männchen / EEF - ANALYST
    • Leandro Pereira - REMEDIATION_DEVELOPER

Affected packages

Hex / mdex

Package

Name
mdex
Purl
pkg:hex/mdex

Affected ranges

Type
SEMVER
Events
Introduced
0.14.3
Fixed
0.15.0

Affected versions

0.*
0.14.3
0.14.4
0.14.5
0.14.6
0.14.7
0.14.8
0.14.9

Ecosystem specific

{
    "$schema":  "https://cna.erlef.org/schemas/osv/affected-0.1.0.json",
    "modules":  [
        "'Elixir.MDEx.FragmentParser'"
    ],
    "program_files":  [
        "lib/mdex/fragment_parser.ex"
    ],
    "program_routines":  [
        "'Elixir.MDEx.FragmentParser':text_label/1",
        "'Elixir.MDEx.FragmentParser':pending_link/3",
        "'Elixir.MDEx.FragmentParser':complete/2",
        "'Elixir.MDEx.FragmentParser':complete_with_state/3"
    ]
}

Database specific

$schema
"https://cna.erlef.org/schemas/osv/affected-0.1.0.json"
modules
[
    "'Elixir.MDEx.FragmentParser'"
]
program_files
[
    "lib/mdex/fragment_parser.ex"
]
program_routines
[
    "'Elixir.MDEx.FragmentParser':text_label/1",
    "'Elixir.MDEx.FragmentParser':pending_link/3",
    "'Elixir.MDEx.FragmentParser':complete/2",
    "'Elixir.MDEx.FragmentParser':complete_with_state/3"
]
source
"https://cna.erlef.org/osv/EEF-CVE-2026-135699.json"

Git / github.com/leandrocp/mdex

Affected ranges

Type
GIT
Repo
https://github.com/leandrocp/mdex
Events

Affected versions

v0.*
v0.14.3
v0.14.4
v0.14.5
v0.14.6
v0.14.7
v0.14.8
v0.14.9

Database specific

$schema
"https://cna.erlef.org/schemas/osv/affected-0.1.0.json"
modules
[
    "'Elixir.MDEx.FragmentParser'"
]
program_files
[
    "lib/mdex/fragment_parser.ex"
]
program_routines
[
    "'Elixir.MDEx.FragmentParser':text_label/1",
    "'Elixir.MDEx.FragmentParser':pending_link/3",
    "'Elixir.MDEx.FragmentParser':complete/2",
    "'Elixir.MDEx.FragmentParser':complete_with_state/3"
]
source
"https://cna.erlef.org/osv/EEF-CVE-2026-135699.json"