{
    "dataType": "CVE_RECORD",
    "dataVersion": "5.2",
    "cveMetadata": {
        "cveId": "CVE-2026-129522",
        "assignerOrgId": "6b3ad84c-e1a6-4bf7-a703-f496b71e49db",
        "state": "PUBLISHED",
        "assignerShortName": "EEF",
        "dateReserved": "2026-11-30T14:16:00.987Z",
        "datePublished": "2026-11-30T18:45:21.032Z",
        "dateUpdated": "2026-11-30T18:59:32.097Z"
    },
    "containers": {
        "cna": {
            "affected": [
                {
                    "collectionURL": "https://repo.hex.pm",
                    "cpes": [
                        "cpe:2.3:a:leandrocp:mdex:*:*:*:*:*:*:*:*"
                    ],
                    "defaultStatus": "unaffected",
                    "modules": [
                        "'Elixir.MDEx.FragmentParser'",
                        "'Elixir.MDEx'"
                    ],
                    "packageName": "mdex",
                    "packageURL": "pkg:hex/mdex",
                    "product": "mdex",
                    "programFiles": [
                        "lib/mdex/fragment_parser.ex",
                        "lib/mdex.ex"
                    ],
                    "programRoutines": [
                        {
                            "name": "'Elixir.MDEx.FragmentParser':close_bracket/5"
                        },
                        {
                            "name": "'Elixir.MDEx.FragmentParser':continue_after_link/2"
                        },
                        {
                            "name": "'Elixir.MDEx.FragmentParser':complete/2"
                        },
                        {
                            "name": "'Elixir.MDEx':stream/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'",
                        "'Elixir.MDEx'"
                    ],
                    "packageName": "leandrocp/mdex",
                    "packageURL": "pkg:github/leandrocp/mdex",
                    "product": "mdex",
                    "programFiles": [
                        "lib/mdex/fragment_parser.ex",
                        "lib/mdex.ex"
                    ],
                    "programRoutines": [
                        {
                            "name": "'Elixir.MDEx.FragmentParser':close_bracket/5"
                        },
                        {
                            "name": "'Elixir.MDEx.FragmentParser':continue_after_link/2"
                        },
                        {
                            "name": "'Elixir.MDEx.FragmentParser':complete/2"
                        },
                        {
                            "name": "'Elixir.MDEx':stream/2"
                        }
                    ],
                    "repo": "https://github.com/leandrocp/mdex",
                    "vendor": "leandrocp",
                    "versions": [
                        {
                            "lessThan": "2c29b28cd0473c24347aa00b95d16f9ce5f9d9af",
                            "status": "affected",
                            "version": "bea359152bc1f63f3256ee86ca207151b815940d",
                            "versionType": "git"
                        }
                    ]
                }
            ],
            "configurations": [
                {
                    "lang": "en",
                    "supportingMedia": [
                        {
                            "base64": false,
                            "type": "text/html",
                            "value": "<p>The application must render untrusted Markdown with auto-closing enabled: through <code>MDEx.stream/2</code>, where it is on unless <code>auto_close: false</code> is passed, or with the <code>auto_close</code> option set on a document. Rendering with the default options of <code>MDEx.to_html/2</code> and <code>MDEx.parse_document/2</code> does not run the affected scanner.</p>"
                        },
                        {
                            "base64": false,
                            "type": "text/markdown",
                            "value": "The application must render untrusted Markdown with auto-closing enabled: through `MDEx.stream/2`, where it is on unless `auto_close: false` is passed, or with the `auto_close` option set on a document. Rendering with the default options of `MDEx.to_html/2` and `MDEx.parse_document/2` does not run the affected scanner."
                        }
                    ],
                    "value": "The application must render untrusted Markdown with auto-closing enabled: through MDEx.stream/2, where it is on unless auto_close: false is passed, or with the auto_close option set on a document. Rendering with the default options of MDEx.to_html/2 and MDEx.parse_document/2 does not run the affected scanner."
                }
            ],
            "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:55:34.000Z",
            "datePublic": "2026-11-30T18:45:20.000Z",
            "descriptions": [
                {
                    "lang": "en",
                    "supportingMedia": [
                        {
                            "base64": false,
                            "type": "text/html",
                            "value": "<p>Inefficient Algorithmic Complexity vulnerability in <code>MDEx.FragmentParser</code> in leandrocp mdex allows an attacker who controls streamed or auto-closed Markdown to cause a denial of service through CPU exhaustion. Any application that renders untrusted Markdown with <code>MDEx.stream/2</code> or the <code>auto_close</code> option is affected, for example live previews or streamed LLM output.</p>\n<p>While auto-closing the last paragraph, <code>close_bracket/5</code> in <code>lib/mdex/fragment_parser.ex</code> runs an unbounded forward scan of the link tail for every <code>](</code>. When that scan finds no valid link, scanning resumes just after the <code>]</code>, so the next <code>](</code> rescans the same tail. Each closed link also re-filters every pending image opener. Repeated <code>[](x (</code>, <code>[](x(</code>, or <code>![</code> openers in one paragraph therefore cost quadratic time, and about 100 KB of input occupies a scheduler for over ten seconds.</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 `MDEx.FragmentParser` in leandrocp mdex allows an attacker who controls streamed or auto-closed Markdown to cause a denial of service through CPU exhaustion. Any application that renders untrusted Markdown with `MDEx.stream/2` or the `auto_close` option is affected, for example live previews or streamed LLM output.\n\nWhile auto-closing the last paragraph, `close_bracket/5` in `lib/mdex/fragment_parser.ex` runs an unbounded forward scan of the link tail for every `](`. When that scan finds no valid link, scanning resumes just after the `]`, so the next `](` rescans the same tail. Each closed link also re-filters every pending image opener. Repeated `[](x (`, `[](x(`, or `![` openers in one paragraph therefore cost quadratic time, and about 100 KB of input occupies a scheduler for over ten seconds.\n\nThis issue affects mdex: from 0.14.2 before 0.15.0."
                        }
                    ],
                    "value": "Inefficient Algorithmic Complexity vulnerability in MDEx.FragmentParser in leandrocp mdex allows an attacker who controls streamed or auto-closed Markdown to cause a denial of service through CPU exhaustion. Any application that renders untrusted Markdown with MDEx.stream/2 or the auto_close option is affected, for example live previews or streamed LLM output.\n\nWhile auto-closing the last paragraph, close_bracket/5 in lib/mdex/fragment_parser.ex runs an unbounded forward scan of the link tail for every ](. When that scan finds no valid link, scanning resumes just after the ], so the next ]( rescans the same tail. Each closed link also re-filters every pending image opener. Repeated [](x (, [](x(, or ![ openers in one paragraph therefore cost quadratic time, and about 100 KB of input occupies a scheduler for over ten seconds.\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 a streaming or auto-closing renderer can occupy a CPU scheduler for seconds per request with about 100 KB of input, slowing or denying rendering for other users.</p>"
                                },
                                {
                                    "base64": false,
                                    "type": "text/markdown",
                                    "value": "An attacker who can submit Markdown to a streaming or auto-closing renderer can occupy a CPU scheduler for seconds per request with about 100 KB of input, slowing or denying rendering for other users."
                                }
                            ],
                            "value": "An attacker who can submit Markdown to a streaming or auto-closing renderer can occupy a CPU scheduler for seconds per request with about 100 KB of input, slowing or denying 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": {
                "orgId": "6b3ad84c-e1a6-4bf7-a703-f496b71e49db",
                "shortName": "EEF",
                "dateUpdated": "2026-11-30T18:45:21.032Z"
            },
            "references": [
                {
                    "name": "EEF CNA record for CVE-2026-129522",
                    "tags": [
                        "related",
                        "third-party-advisory"
                    ],
                    "url": "https://cna.erlef.org/cves/CVE-2026-129522.html"
                },
                {
                    "name": "OSV record EEF-CVE-2026-129522",
                    "tags": [
                        "related"
                    ],
                    "url": "https://osv.dev/vulnerability/EEF-CVE-2026-129522"
                },
                {
                    "name": "Introducing commit bea3591 in leandrocp/mdex",
                    "tags": [
                        "related"
                    ],
                    "url": "https://github.com/leandrocp/mdex/commit/bea359152bc1f63f3256ee86ca207151b815940d"
                },
                {
                    "name": "Fix commit 2c29b28 in leandrocp/mdex",
                    "tags": [
                        "patch"
                    ],
                    "url": "https://github.com/leandrocp/mdex/commit/2c29b28cd0473c24347aa00b95d16f9ce5f9d9af"
                }
            ],
            "source": {
                "discovery": "INTERNAL"
            },
            "title": "Quadratic rescanning in MDEx auto-close link scanner allows CPU denial of service",
            "x_proofOfConcept": [
                {
                    "lang": "en",
                    "supportingMedia": [
                        {
                            "base64": false,
                            "type": "text/html",
                            "value": "<ol>\n<li>Build a single paragraph of 20,000 repetitions of <code>[](x (</code> followed by <code>) z</code> (about 120 KB, no blank line).</li>\n<li>Pass it as one chunk to <code>MDEx.stream/2</code> and consume the stream.</li>\n<li>Observe the call take over ten seconds, while <code>MDEx.to_html!/1</code> on the same input returns in about 10 ms. Doubling the input roughly quadruples the time.</li>\n</ol>"
                        },
                        {
                            "base64": false,
                            "type": "text/markdown",
                            "value": "1. Build a single paragraph of 20,000 repetitions of `[](x (` followed by `) z` (about 120 KB, no blank line).\n2. Pass it as one chunk to `MDEx.stream/2` and consume the stream.\n3. Observe the call take over ten seconds, while `MDEx.to_html!/1` on the same input returns in about 10 ms. Doubling the input roughly quadruples the time."
                        }
                    ],
                    "value": "* Build a single paragraph of 20,000 repetitions of [](x ( followed by ) z (about 120 KB, no blank line).\n* Pass it as one chunk to MDEx.stream/2 and consume the stream.\n* Observe the call take over ten seconds, while MDEx.to_html!/1 on the same input returns in about 10 ms. Doubling the input roughly quadruples the time."
                }
            ],
            "x_technicalAnalysis": [
                {
                    "lang": "en",
                    "supportingMedia": [
                        {
                            "base64": false,
                            "type": "text/html",
                            "value": "<p><strong>1. Entry.</strong> <code>MDEx.stream/2</code> (auto-close on by default) and documents with <code>auto_close</code> call <code>MDEx.FragmentParser.complete/2</code>, which reaches <code>incomplete_paragraph_link/5</code> and <code>open_link/5</code> for the last paragraph. Scanning stops at a blank line, so an attacker who never sends one keeps the whole input in scope.</p>\n<p><strong>2. Rescan.</strong> For every <code>](</code>, <code>close_bracket/5</code> calls <code>link_tail/2</code>, which scans forward without bound through <code>bare_destination/3</code>, <code>link_title_end/4</code> and <code>link_close/2</code>. When the tail is <code>:invalid</code>, <code>continue_after_link/2</code> resumes just after the <code>]</code>, so the next <code>](</code> rescans the same tail. An unterminated title (<code>[](x (</code> repeated) or nested parentheses (<code>[](x(</code> repeated) makes every scan run to the end of the paragraph.</p>\n<p><strong>3. Opener filtering.</strong> Each closed link runs <code>Enum.filter/2</code> over every pending opener to keep only images. With <code>![</code> repeated N times followed by N closed links, that is N filters over N openers.</p>\n<p>All three shapes cost O(N^2). The reporter measured 120 KB of <code>[](x (</code> at 12.0 s in a one-chunk <code>MDEx.stream/2</code>, against about 10 ms for <code>MDEx.to_html!/1</code> without auto-close.</p>"
                        },
                        {
                            "base64": false,
                            "type": "text/markdown",
                            "value": "**1. Entry.** `MDEx.stream/2` (auto-close on by default) and documents with `auto_close` call `MDEx.FragmentParser.complete/2`, which reaches `incomplete_paragraph_link/5` and `open_link/5` for the last paragraph. Scanning stops at a blank line, so an attacker who never sends one keeps the whole input in scope.\n\n**2. Rescan.** For every `](`, `close_bracket/5` calls `link_tail/2`, which scans forward without bound through `bare_destination/3`, `link_title_end/4` and `link_close/2`. When the tail is `:invalid`, `continue_after_link/2` resumes just after the `]`, so the next `](` rescans the same tail. An unterminated title (`[](x (` repeated) or nested parentheses (`[](x(` repeated) makes every scan run to the end of the paragraph.\n\n**3. Opener filtering.** Each closed link runs `Enum.filter/2` over every pending opener to keep only images. With `![` repeated N times followed by N closed links, that is N filters over N openers.\n\nAll three shapes cost O(N^2). The reporter measured 120 KB of `[](x (` at 12.0 s in a one-chunk `MDEx.stream/2`, against about 10 ms for `MDEx.to_html!/1` without auto-close."
                        }
                    ],
                    "value": "1. Entry. MDEx.stream/2 (auto-close on by default) and documents with auto_close call MDEx.FragmentParser.complete/2, which reaches incomplete_paragraph_link/5 and open_link/5 for the last paragraph. Scanning stops at a blank line, so an attacker who never sends one keeps the whole input in scope.\n\n2. Rescan. For every ](, close_bracket/5 calls link_tail/2, which scans forward without bound through bare_destination/3, link_title_end/4 and link_close/2. When the tail is :invalid, continue_after_link/2 resumes just after the ], so the next ]( rescans the same tail. An unterminated title ([](x ( repeated) or nested parentheses ([](x( repeated) makes every scan run to the end of the paragraph.\n\n3. Opener filtering. Each closed link runs Enum.filter/2 over every pending opener to keep only images. With ![ repeated N times followed by N closed links, that is N filters over N openers.\n\nAll three shapes cost O(N^2). The reporter measured 120 KB of [](x ( at 12.0 s in a one-chunk MDEx.stream/2, against about 10 ms for MDEx.to_html!/1 without auto-close."
                }
            ]
        },
        "adp": [
            {
                "metrics": [
                    {
                        "other": {
                            "type": "ssvc",
                            "content": {
                                "timestamp": "2026-11-30T18:59:25.419476Z",
                                "id": "CVE-2026-129522",
                                "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-30T18:59:32.097Z"
                }
            }
        ]
    }
}