league/commonmark: Denial of service via adjacent inline attribute blocks
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.
AI Analysis
Technical Summary
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.
league/commonmark: Denial of service via adjacent inline attribute blocks
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
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
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.
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 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
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
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.