Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

league/commonmark: Denial of service via colliding heading slugs

0
High
Published: 08/06/2026 (08/06/2026, 20:41:45 UTC)
Source: GCVE Database
Product: league/commonmark

Description

A denial of service vulnerability exists in league/commonmark versions 2.0.0 through 2.8.x due to a quadratic algorithmic complexity in the UniqueSlugNormalizer::normalize() function. This function restarts its search for unique slug suffixes from 1 on every collision, causing O(K²) CPU cost for K colliding slugs. The issue affects processing of headings and footnotes when certain extensions are enabled, allowing an attacker to cause significant CPU consumption and service disruption without authentication. Workarounds include disabling slug uniqueness or affected extensions, but upgrading to a patched release is recommended.

CVSS v3.1

Score 7.5high

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Affected software

Packagistghsa
league/commonmark
Affected versions
>=2.0.0 <2.9.0

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 08/07/2026, 06:11:50 UTC

Technical Analysis

The UniqueSlugNormalizer in league/commonmark (introduced in 2.0.0) attempts to ensure unique slugs by searching for unused numeric suffixes starting from 1 on each collision, resulting in quadratic time complexity (O(K²)) when many headings collapse to the same base slug. This can be trivially triggered by attacker-controlled Markdown containing many identical or empty headings, causing denial of service by excessive CPU usage. The vulnerability is triggered when HeadingPermalinkExtension, FootnoteExtension, or TableOfContentsExtension are used, as they normalize headings or footnotes with this slug normalizer. No authentication is required. Versions from 2.0.0 up to but not including 2.9.0 are affected. Workarounds include disabling slug uniqueness or the affected extensions, or limiting document size, but the recommended fix is upgrading to a patched version that removes the quadratic behavior while preserving functionality.

Potential Impact

An attacker can cause denial of service by submitting Markdown documents with many colliding headings or footnotes that cause the slug normalization process to consume excessive CPU resources. This leads to service unavailability or degraded performance. There is no impact on confidentiality or integrity. No authentication is required to trigger the vulnerability.

Mitigation Recommendations

A patch is available that removes the quadratic behavior while maintaining unique slug IDs and output correctness. Users should upgrade to a patched release at or beyond version 2.9.0. As temporary workarounds, integrators can disable slug uniqueness by setting slug_normalizer/unique to false, disable the HeadingPermalinkExtension and TableOfContentsExtension (which depends on it), and FootnoteExtension for untrusted Markdown, or limit document size and heading count upstream to avoid triggering the quadratic cost. These workarounds trade off functionality or correctness and are not recommended long-term.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Gcve Source
db.gcve.eu
Osv Id
GHSA-mh25-x5hq-wrqp
Osv Schema Version
1.4.0
Aliases
[]
Ecosystems
["Packagist"]
Database Specific Severity
HIGH
Cvss Version
3.1

Threat ID: 6a7573c1bf8831d539d945c8

Added to database: 08/07/2026, 05:57:21 UTC

Last enriched: 08/07/2026, 06:11:50 UTC

Last updated: 08/07/2026, 07:19:52 UTC

Views: 4

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses