# thephpleague commonmark denial of service in UniqueSlugNormalizer

Source: https://junglewise.ai/threats/thephpleague-commonmark-denial-of-service-in-uniqueslugnormalizer-94ab233b  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-08-06. Updated: 2026-08-06  
License: CC BY 4.0 with a link back

Severity: high · CVSS 7.5 · Published 2026-08-06

A performance vulnerability in the league/commonmark PHP library can allow an attacker to crash or slow down a website by providing specially crafted Markdown text. The library, which is used to convert Markdown into HTML, contains a flaw in how it handles duplicate headings, leading to excessive processor usage. This can result in a denial-of-service (DoS) condition where the server becomes unresponsive to legitimate users.

Technologies: [league/commonmark (Packagist)](https://junglewise.ai/threats/technologies/league-commonmark), [The PHP League CommonMark](https://junglewise.ai/threats/technologies/commonmark). Vendors: [Packagist](https://junglewise.ai/threats/vendors/packagist), [The PHP League](https://junglewise.ai/threats/vendors/the-php-league).

## Quick answers

**Is This vulnerability exploited in the wild?** No. Junglewise Threat Intelligence has no report of This vulnerability being exploited in the wild.

**How severe is This vulnerability?** High severity, with a CVSS score of 7.5, published 6 August 2026.

**Which products and versions are affected?** league/commonmark (Packagist) >= 2.0.0, < 2.9.0; The PHP League CommonMark >= 2.0.0, < 2.9.0.

**Is there a fix for This vulnerability?** A patch was published on 2026-08-06: Version 2.9.0 released Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is This vulnerability attacked?** It is attacked over the network, in a software library.

**Am I affected?** Check whether you run league/commonmark (Packagist) or The PHP League CommonMark at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## Technical details

The `UniqueSlugNormalizer::normalize()` function in league/commonmark versions 2.0.0 through 2.8.x exhibits O(K²) quadratic time complexity when handling colliding heading slugs. When generating unique anchors for headings, the normalizer restarts its search for an unused numeric suffix from '1' for every collision, leading to a massive increase in array lookups as the number of identical or empty headings increases. An unauthenticated remote attacker can exploit this by submitting a Markdown document with many identical headings or headings that normalize to empty strings (e.g., punctuation-only), causing high CPU consumption and service exhaustion. This affects configurations using `HeadingPermalinkExtension`, `FootnoteExtension`, or `TableOfContentsExtension`. The issue is resolved in version 2.9.0.

## Affected products

- thephpleague commonmark >= 2.0.0, < 2.9.0

## Timeline

- 2026-08-03: disclosed: Initial report to maintainers
- 2026-08-06: advisory: GitHub Advisory published
- 2026-08-06: patched: Version 2.9.0 released

## References

- [https://api.github.com/users/GrahamCampbell](https://api.github.com/users/GrahamCampbell)
- [https://github.com/GrahamCampbell](https://github.com/GrahamCampbell)
- [https://api.github.com/users/GrahamCampbell/gists%7B/gist_id%7D](https://api.github.com/users/GrahamCampbell/gists%7B/gist_id%7D)
- [https://api.github.com/users/GrahamCampbell/repos](https://api.github.com/users/GrahamCampbell/repos)
- [https://avatars.githubusercontent.com/u/2829600?v=4](https://avatars.githubusercontent.com/u/2829600?v=4)
- [https://api.github.com/users/GrahamCampbell/events%7B/privacy%7D](https://api.github.com/users/GrahamCampbell/events%7B/privacy%7D)

## Related threats

- [league/commonmark DisallowedRawHtml XSS bypass in tag parsing](https://junglewise.ai/threats/league-commonmark-disallowedrawhtml-bypassed-when-a-disallowed-tag-name-cea607bc)
- [league/commonmark quadratic DoS in GitHub Flavored Markdown table parser](https://junglewise.ai/threats/league-commonmark-quadratic-time-denial-of-service-in-the-github-a4135205)
- [league/commonmark polynomial time complexity denial of service](https://junglewise.ai/threats/cve-2024-58382-league-commonmark-polynomial-time-complexity-denial-of-service)
- [commonmark Footnote extension denial of service](https://junglewise.ai/threats/cve-2026-86435-commonmark-footnote-extension-denial-of-service)
- [commonmark XmlRenderer denial of service via nested XML indentation](https://junglewise.ai/threats/cve-2026-86432-commonmark-xmlrenderer-denial-of-service-via-nested-xml)
