GHSA-c2pc-g5qf-rfrf: League/commonmark Denial of Service Vulnerability
HIGHGHSA-c2pc-g5qf-rfrf is a HIGH (CVSS 7.5) denial of service vulnerability (CWE-407: Inefficient Algorithmic Complexity) affecting League/commonmark libraries in the Packagist ecosystem. The issue involves league/commonmark's quadratic complexity bugs may lead to a denial of service. Remediation is available by upgrading affected packages to version 2.6.0.
GHSA-c2pc-g5qf-rfrf at a Glance
Security Impact
CVSS: 7.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).
How to Fix GHSA-c2pc-g5qf-rfrf
To remediate this vulnerability, upgrade all affected League/commonmark dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade league/commonmark to 2.6.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for league/commonmark
How to Check if You Are Affected
To determine whether your application is affected by GHSA-c2pc-g5qf-rfrf, inspect your project dependencies for League/commonmark:
inspect dependencies for league/commonmark
Analyze the terminal output to locate any version of League/commonmark in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.6.0), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-407: Inefficient Algorithmic Complexity, where an algorithm in a product has an inefficient worst-case computational complexity that may be detrimental to system performance and can be triggered by an attacker, typically using crafted manipulations that ensure that the worst case is being reached. In League/commonmark, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
GHSA-c2pc-g5qf-rfrf Affected League/commonmark Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
league/commonmark
|
Packagist |
< 2.6.0
|
2.6.0
|
References
Frequently Asked Questions
What is GHSA-c2pc-g5qf-rfrf?
Which League/commonmark versions are affected?
What version fixes GHSA-c2pc-g5qf-rfrf?
Is league/commonmark affected?
What is the CVSS score of GHSA-c2pc-g5qf-rfrf?
What CWE is associated with GHSA-c2pc-g5qf-rfrf?
How can I check Packagist dependencies for GHSA-c2pc-g5qf-rfrf?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-c2pc-g5qf-rfrf",
"modified" : "2024-12-09T20:42:08Z",
"published" : "2024-12-09T20:42:07Z",
"aliases" : [ ],
"summary" : "league/commonmark's quadratic complexity bugs may lead to a denial of service",
"details" : "### Impact\n\nSeveral polynomial time complexity issues in league/commonmark may lead to unbounded resource exhaustion and subsequent denial of service.\n\nMalicious users could trigger that inefficient code with carefully crafted Markdown inputs that are specifically designed to ensure the worst-case performance is reached. Sending multiple such requests in parallel could tie up all available CPU resources and/or PHP-FPM processes, leading to denial of service for legitimate users.\n\n### Patches\n\nThese vulnerabilities have been patched in version 2.6.0. All users on older versions are highly encouraged to upgrade as soon as possible.\n\n### Workarounds\n\nIf you cannot upgrade, you may be able to mitigate the issues by:\n\n- Setting very low `memory_limit` and `max_execution_time` PHP configurations to prevent runaway resource usage\n- Implementing rate-limiting, bot protection, or other approaches to reduce the risk of simultaneous bad requests hitting your site\n- Limiting the size of inputs fed into this library (specifically the max length of each line)\n- Limiting the use of this library to trusted users\n\n### References\n\nMost of these issues were discovered in other Markdown parsers. You can read more about them here:\n\n* https://github.com/commonmark/commonmark.js/issues/129\n* https://github.com/commonmark/commonmark.js/issues/157\n* https://github.com/commonmark/commonmark.js/issues/172\n* https://github.com/github/cmark-gfm/security/advisories/GHSA-r572-jvj2-3m8p\n* https://github.com/github/cmark-gfm/security/advisories/GHSA-24f7-9frr-5h2r\n* https://github.com/github/cmark-gfm/security/advisories/GHSA-29g3-96g3-jg6c\n* https://github.com/github/cmark-gfm/security/advisories/GHSA-r8vr-c48j-fcc5\n* https://github.com/github/cmark-gfm/security/advisories/GHSA-w4qg-3vf7-m9x5\n* https://github.com/github/cmark-gfm/security/advisories/GHSA-66g8-4hjf-77xh\n\nFor general information about this type of issue:\n\n* https://en.wikipedia.org/wiki/Time_complexity\n* https://cwe.mitre.org/data/definitions/407.html\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Packagist",
"name" : "league/commonmark"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.6.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/github/cmark-gfm/security/advisories/GHSA-24f7-9frr-5h2r"
}, {
"type" : "WEB",
"url" : "https://github.com/github/cmark-gfm/security/advisories/GHSA-29g3-96g3-jg6c"
}, {
"type" : "WEB",
"url" : "https://github.com/github/cmark-gfm/security/advisories/GHSA-66g8-4hjf-77xh"
}, {
"type" : "WEB",
"url" : "https://github.com/github/cmark-gfm/security/advisories/GHSA-r572-jvj2-3m8p"
}, {
"type" : "WEB",
"url" : "https://github.com/github/cmark-gfm/security/advisories/GHSA-r8vr-c48j-fcc5"
}, {
"type" : "WEB",
"url" : "https://github.com/github/cmark-gfm/security/advisories/GHSA-w4qg-3vf7-m9x5"
}, {
"type" : "WEB",
"url" : "https://github.com/thephpleague/commonmark/security/advisories/GHSA-c2pc-g5qf-rfrf"
}, {
"type" : "WEB",
"url" : "https://github.com/commonmark/commonmark.js/issues/129"
}, {
"type" : "WEB",
"url" : "https://github.com/commonmark/commonmark.js/issues/157"
}, {
"type" : "WEB",
"url" : "https://github.com/commonmark/commonmark.js/issues/172"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/thephpleague/commonmark"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-407" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2024-12-09T20:42:07Z",
"nvd_published_at" : null
}
}