{"id":"CVE-2026-86434","aliases":["CVE-2026-86434","GHSA-mh25-x5hq-wrqp"],"related":[],"kind":"vulnerability","state":"published","title":"commonmark 2.0.0 through 2.8.3 Denial of Service via Slug Collision","summary":"league/commonmark versions >= 2.0.0 and < 2.8.4 (patched in 2.9.0) contain a denial of service vulnerability in UniqueSlugNormalizer::normalize(), which restarts its numeric-suffix search from 1 on every slug collision, resulting in O(K^2) time complexity for K headings that collapse to the same base slug. The vulnerable path is reached when HeadingPermalinkExtension, FootnoteExtension, or TableOfContentsExtension is registered. An unauthenticated attacker can force many headings onto a single base slug (e.g., via empty ATX headings, identical heading text, or punctuation-only headings) in a small Markdown document, consuming excessive CPU and denying service.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"league/commonmark versions >= 2.0.0 and < 2.8.4 (patched in 2.9.0) contain a denial of service vulnerability in UniqueSlugNormalizer::normalize(), which restarts its numeric-suffix search from 1 on every slug collision, resulting in O(K^2) time complexity for K headings that collapse to the same base slug. The vulnerable path is reached when HeadingPermalinkExtension, FootnoteExtension, or TableOfContentsExtension is registered. An unauthenticated attacker can force many headings onto a single base slug (e.g., via empty ATX headings, identical heading text, or punctuation-only headings) in a small Markdown document, consuming excessive CPU and denying service.","source":"cvelist"},{"lang":"en","text":"### Impact\n\n`UniqueSlugNormalizer::normalize()` makes each slug document-unique by searching for an unused numeric suffix, but **restarts that search from `1` on every collision**. The k-th heading that collapses to the same base slug performs k−1 array lookups, so K colliding slugs cost Σ(k−1) = **O(K²)**. An attacker can force every heading onto a single base slug trivially — many empty ATX headings, identical heading text, or punctuation-only headings that normalize to the empty string.\n\nThe path is reached whenever the shared slug normalizer runs over attacker-controlled text. That happens when `HeadingPermalinkExtension` is registered (its `HeadingPermalinkProcessor` normalizes every heading), independently through `FootnoteExtension` (its `AnonymousFootnoteRefParser` normalizes every `^[label]` reference), and on any `TableOfContentsExtension` site (which requires `HeadingPermalinkExtension` to be co-registered). The default `slug_normalizer/unique` setting (`UniqueSlugNormalizerInterface::PER_DOCUMENT`) accumulates collisions across the whole document. No authentication is required — a small document body turns into seconds of CPU and denies service. Availability impact only. **`UniqueSlugNormalizer` was introduced in 2.0.0 (first shipped in 2.0.0-beta1, May 2021); the 1.x heading-permalink slug generator performed no de-duplication and is not affected. All 2.x releases (including 2.8.x) are affected.**\n\n### Workarounds\n\nIntegrators who cannot upgrade immediately can:\n\n- **Set `slug_normalizer/unique` to `false` / `UniqueSlugNormalizerInterface::DISABLED`**, which stops the de-duplication scan entirely — at the cost of losing id uniqueness (colliding headings then share an anchor).\n- **Disable `HeadingPermalinkExtension`** (and `TableOfContentsExtension`, which depends on it), and `FootnoteExtension` where anonymous footnotes reach the same normalizer, for untrusted Markdown.\n- **Cap the accepted document size / heading count upstream** so K cannot reach the quadratic danger zone.\n\nEach of these trades off functionality or correctness; upgrading to the patched release (which removes the quadratic behavior while keeping unique ids and identical output) is the recommended remediation.","format":"markdown","source":"ghsa"}],"published":"2026-08-06T20:41:45.000Z","modified":"2026-10-20T12:11:18.651Z","severity":{"scorer":"VulnCheck","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N","score":8.7,"rating":"HIGH"},"severities":[{"scorer":"VulnCheck","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N","score":8.7,"rating":"HIGH"},{"scorer":"VulnCheck","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"}],"cwes":["CWE-407"],"affected":[{"ranges":[{"type":"semver","introduced":"2.0.0","fixed":"2.8.4","status":"affected"},{"type":"semver","version":"2.8.4","status":"unaffected"}],"vendor":"thephpleague","product":"commonmark","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"2.0.0","status":"affected","fixed":"2.9.0"}],"ecosystem":"Packagist","package":"league/commonmark","purl":"pkg:composer/league/commonmark","source":"ghsa"}],"references":[{"url":"https://github.com/thephpleague/commonmark/security/advisories/GHSA-mh25-x5hq-wrqp","tags":["vendor-advisory","web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://www.vulncheck.com/advisories/commonmark-2.0.0-through-2.8.3-denial-of-service-via-slug-collision","tags":["third-party-advisory"],"sources":["cvelist","nvd"]},{"url":"https://github.com/thephpleague/commonmark","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/thephpleague/commonmark/releases/tag/2.9.0","tags":["web"],"sources":["ghsa"]}],"credits":["GrahamCampbell"],"assigner":"VulnCheck","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"partial","date":"2026-09-18T17:42:05.970Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-86434","url":"https://www.cve.org/CVERecord?id=CVE-2026-86434","licence":"CVE Terms of Use","modified":"2026-10-08T15:25:54.536Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-mh25-x5hq-wrqp","url":"https://github.com/advisories/GHSA-mh25-x5hq-wrqp","licence":"CC-BY-4.0","modified":"2026-10-20T12:11:18.651Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-86434","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-86434","licence":"Public domain","modified":"2026-10-08T16:17:57.953Z"}],"updatedAt":"2026-11-25T22:59:36.531Z","epss":{"score":0.00291,"percentile":0.23354,"date":"2026-12-01T12:00:22.000Z"}}