Skip to main content

league/commonmark: Denial of service via adjacent inline attribute blocks

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

Description

A denial of service vulnerability exists in league/commonmark when the Attributes extension is enabled. The vulnerability arises from a quadratic time complexity in resolving adjacent inline attribute blocks at the start of a block, causing excessive CPU usage. An unauthenticated attacker can exploit this by submitting crafted input that triggers long processing times, impacting availability. This affects all versions from 1.5.0 up to but not including 2.9.0. A patch is available to address this issue.

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
>=1.5.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:41 UTC

Technical Analysis

The Attributes extension in league/commonmark (introduced in version 1.5.0) uses an algorithm in AttributesListener::findTargetAndDirection() that resolves each attribute node's target by scanning outward through sibling nodes. For a run of N adjacent inline attribute blocks at the start of a block, each node scans the entire sibling list to the far right, resulting in a quadratic time complexity (Θ(N²)) during parsing. This behavior is unconditional and not mitigated by configuration options such as the attributes/allow allow-list or other hardening features. An attacker can submit approximately 32 KB of input (e.g., repeated '{#a}' 8,000 times) to cause parsing to take over 5 seconds, leading to a denial of service via high CPU consumption. The vulnerability affects all releases from 1.5.0 through versions before 2.9.0. No known exploits are reported in the wild. Mitigation includes disabling the Attributes extension for untrusted input or imposing strict input length limits. Upgrading to a fixed release is recommended.

Potential Impact

This vulnerability allows an unauthenticated attacker to cause a denial of service by submitting specially crafted input that triggers a quadratic parsing time in the Attributes extension, resulting in high CPU usage and degraded availability of the service using league/commonmark. There is no impact on confidentiality or integrity.

Mitigation Recommendations

A patch is available for this vulnerability. Users are advised to upgrade to a fixed version of league/commonmark at or beyond 2.9.0. If upgrading is not immediately possible, mitigations include disabling the Attributes extension for untrusted input or enforcing strict maximum input length limits to reduce exposure to the quadratic parsing behavior.

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-g2gp-3wwq-f4ph
Osv Schema Version
1.4.0
Ecosystems
["Packagist"]
Database Specific Severity
HIGH
Cvss Version
3.1

Threat ID: 6a7573c1bf8831d539d945cd

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

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

Last updated: 09/21/2026, 11:52:21 UTC

Views: 37

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