league/commonmark: Denial of service via adjacent inline attribute blocks
High severity. Published 6 August 2026. Update league/commonmark to 2.9.0 or later: composer update league/commonmark.
Which versions are affected?
| Package | Affected versions | Fixed in |
|---|---|---|
| league/commonmark (opens in a new tab) | >= 1.5.0, < 2.9.0 | 2.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 auditAdvisory details
| Severity | HighCVSS 7.5 |
|---|---|
| Published | |
| Updated | |
| GHSA | GHSA-g2gp-3wwq-f4ph (opens in a new tab) |
| Weakness | CWE-407 |
What the advisory says
Impact
With the Attributes extension enabled, AttributesListener::findTargetAndDirection() resolves each attribute node's target by walking outward through its siblings. For a run of N adjacent inline attribute blocks placed at the start of a block (with nothing to their left), each node scans the entire sibling list to the far-right end before giving up and falling back to the parent. Each resolution is therefore Θ(N) and the whole run is Θ(N²).
Reaching the path requires AttributesExtension (opt-in, but first-party: League\CommonMark\Extension\Attributes\AttributesExtension).
Source: GHSA-g2gp-3wwq-f4ph (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
- league/commonmark: DisallowedRawHtml bypassed when a disallowed tag name ends the raw-HTML literal (opens in a new tab) (medium, 30 September 2026)
- league/commonmark: Quadratic-time denial of service in the GitHub Flavored Markdown Table extension block-start scan (high, 30 September 2026)
- league/commonmark: Denial of service in the SmartPunct and Attributes extensions (high, 1 September 2026)
- league/commonmark: Denial of service via crafted code fences, reference links, and emphasis delimiters (high, 1 September 2026)
- league/commonmark XSS: `on*` event-handler filter in `AttributesExtension` bypassed with a U+000C form feed (high, 1 September 2026)