BuzzPHP
LightDarkSystem

league/commonmark: Denial of service via colliding heading slugs

High severity. Published 6 August 2026. Update league/commonmark to 2.9.0 or later: composer update league/commonmark.

Which versions are affected?

PackageAffected versionsFixed in
league/commonmark (opens in a new tab)>= 2.0.0, < 2.9.02.9.0

What should you do?

Update every affected package you use to its fixed version, then check that nothing else in your project matches an advisory. To see which version you run, and whether anything is still affected:

composer show league/commonmark
composer audit

Advisory details

SeverityHighCVSS 7.5
Published
Updated
GHSAGHSA-mh25-x5hq-wrqp (opens in a new tab)
WeaknessCWE-407

What the advisory says

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.

Source: GHSA-mh25-x5hq-wrqp (opens in a new tab) in the GitHub Advisory Database (CC BY 4.0). Data from GitHub (opens in a new tab) as of .

Other recent advisories for this package

All Composer security advisories