# league/commonmark: Denial of service via colliding heading slugs

High severity, published 2026-08-06. Update league/commonmark to 2.9.0 or later: composer update league/commonmark.

Canonical URL: https://buzzphp.com/security/ghsa-mh25-x5hq-wrqp · Data from GitHub as of 2026-11-25.

| | |
| --- | --- |
| Severity | high (CVSS 7.5) |
| Published | 2026-08-06 |
| Updated | 2026-08-06 |
| GHSA | [GHSA-mh25-x5hq-wrqp](https://github.com/advisories/GHSA-mh25-x5hq-wrqp) |
| Weakness | CWE-407 |

| Package | Affected versions | Fixed in |
| --- | --- | --- |
| league/commonmark | >= 2.0.0, < 2.9.0 | 2.9.0 |

## What to do

Update league/commonmark to 2.9.0 or later: composer update league/commonmark.

Check which version you run with `composer show league/commonmark`, and every affected package with `composer audit`.

## About this advisory

Impact

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.

The path is reached whenever the shared slug normalizer runs over attacker-controlled text.

## Links

- [GHSA-mh25-x5hq-wrqp on GitHub](https://github.com/advisories/GHSA-mh25-x5hq-wrqp)
- [All Composer security advisories](https://buzzphp.com/security)
