GHSA-G2GP-3WWQ-F4PH

GHSA-G2GP-3WWQ-F4PH is a high-severity security vulnerability in league/commonmark (composer), affecting versions >= 1.5.0, < 2.9.0. It is fixed in 2.9.0.

Does this CVE actually affect you?

Kodem shows which CVEs are reachable and running in your applications, so you fix what's exploitable, not just what's listed.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Runtime intelligence, not another scanner.

Summary

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

Workarounds

There is no library-level configuration that gates the quadratic walk. Integrators who cannot upgrade can only reduce exposure indirectly:

  • Disable the Attributes extension for untrusted input, or
  • Impose a strict maximum input length before conversion, noting that because the cost is quadratic, even a modest cap must be small to meaningfully bound worst-case CPU.

Upgrading to a release containing the fix is recommended.

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). No other configuration matters, the quadratic walk runs unconditionally during parsing and is not gated by the attributes/allow allow-list, the on* hardening added in 2.7.0, or allow_unsafe_links. An unauthenticated attacker can submit a ~32 KB input ({#a} repeated 8,000 times) that takes over 5 seconds to convert, with time growing quadratically in input length, a cheap denial of service. Availability impact only. The Attributes extension was introduced in 1.5.0 (May 2020) with this outward-walk resolver present from the first commit, so all releases from 1.5.0 onward (including every 2.x) are affected.

GHSA-G2GP-3WWQ-F4PH has a CVSS score of 7.5 (High). The vector is network-reachable, no privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (2.9.0); upgrading removes the vulnerable code path.

Affected versions

league/commonmark (>= 1.5.0, < 2.9.0)

Security releases

league/commonmark → 2.9.0 (composer)

Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.

Already deployed Kodem?

See it in your environmentNew to Kodem? Get a demo →

Remediation advice

Upgrade league/commonmark to 2.9.0 or later to resolve this vulnerability.

Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.

Frequently Asked Questions

  1. What is GHSA-G2GP-3WWQ-F4PH? GHSA-G2GP-3WWQ-F4PH is a high-severity security vulnerability in league/commonmark (composer), affecting versions >= 1.5.0, < 2.9.0. It is fixed in 2.9.0.
  2. How severe is GHSA-G2GP-3WWQ-F4PH? GHSA-G2GP-3WWQ-F4PH has a CVSS score of 7.5 (High). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
  3. Which versions of league/commonmark are affected by GHSA-G2GP-3WWQ-F4PH? league/commonmark (composer) versions >= 1.5.0, < 2.9.0 is affected.
  4. Is there a fix for GHSA-G2GP-3WWQ-F4PH? Yes. GHSA-G2GP-3WWQ-F4PH is fixed in 2.9.0. Upgrade to this version or later.
  5. Is GHSA-G2GP-3WWQ-F4PH exploitable, and should I be worried? Whether GHSA-G2GP-3WWQ-F4PH is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
  6. What actually determines whether GHSA-G2GP-3WWQ-F4PH is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
  7. How do I fix GHSA-G2GP-3WWQ-F4PH? Upgrade league/commonmark to 2.9.0 or later.

Other vulnerabilities in league/commonmark

Stop the waste.
Protect your environment with Kodem.