Skip to main content

league/commonmark CVE-2026-71488

| EUVDEUVD-2026-54143 HIGH
Inefficient Algorithmic Complexity (CWE-407)
2026-08-06 https://github.com/thephpleague/commonmark GHSA-2q4p-g7hv-5rgv
7.5
CVSS 3.1 · Vendor: https://github.com/thephpleague/commonmark
Share

Severity by source

Vendor (https://github.com/thephpleague/commonmark) PRIMARY
7.5 HIGH
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
vuln.today AI
7.5 HIGH

Network-reachable over HTTP with no authentication or interaction; impact is pure availability exhaustion with zero confidentiality or integrity effect confirmed by vendor.

3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
4.0 AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N

Primary rating from Vendor (https://github.com/thephpleague/commonmark).

CVSS VectorVendor: https://github.com/thephpleague/commonmark

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

Lifecycle Timeline

3
Source Code Evidence Fetched
Aug 06, 2026 - 21:06 vuln.today
Analysis Generated
Aug 06, 2026 - 21:06 vuln.today
CVE Published
Aug 06, 2026 - 20:37 github-advisory
HIGH 7.5

DescriptionCVE.org

Impact

Affected versions of league/commonmark can have quadratic time complexity when parsing specially crafted Markdown lines. In practical terms, doubling the length of an affected line can make the parser perform roughly four times as much work. The parser identifies locations using character positions, but regular-expression matches report byte positions. These positions differ when a UTF-8 character uses more than one byte. Several parsing paths repeatedly rescan growing portions of the line to translate between the two positions. The Autolink extension can also copy and validate the remaining line at every URL-like prefix.

In current 2.x releases, a single non-ASCII character anywhere on a line can place that whole line on the slower multibyte path. An attacker can combine it with a long run of leading whitespace or repeated Markdown punctuation, causing increasingly large rescans. When the Autolink extension is enabled, repeated URL-like prefixes provide another trigger, even on ASCII-only lines. Each trigger fits within one long line, so complex Markdown structure is unnecessary.

An attacker who can submit Markdown for conversion can use a comparatively small request to consume disproportionate CPU time and allocation activity. Repeated or concurrent requests can occupy all available PHP workers and prevent legitimate requests from completing. The core paths affect CommonMarkConverter, GithubFlavoredMarkdownConverter, and custom environments. The autolink-specific path affects applications using AutolinkExtension or GithubFlavoredMarkdownExtension. Applications that process only trusted Markdown are not remotely exploitable. The impact is limited to availability: it does not disclose data, change rendered output, or bypass rendering restrictions. Settings such as html_input and allow_unsafe_links do not mitigate the issue because the expensive work occurs before rendering.

Patches

The issue is patched in 2.9.0 and later. Starting in that release, the parser records UTF-8 character-to-byte positions incrementally, converts ordered regular-expression match positions without restarting from the beginning of the line, and matches autolinks against the original line instead of copying every remaining suffix. The affected work then grows in direct proportion to the input size while preserving existing Markdown output and configuration behavior. Versions from 0.6.0 through 2.8.3 are affected. The 0.x and 1.x release lines are no longer supported, so their users must upgrade to 2.9.0 or later.

Workarounds

If you cannot upgrade immediately, reject or truncate inputs with excessively long individual lines before passing them to the converter. A total request-size limit is also useful, but a per-line limit is important because every demonstrated trigger fits on one line. Choose limits appropriate for the application and enforce them before Markdown parsing begins. Restricting conversion to trusted users, applying strict execution-time limits, rate-limiting requests, and limiting concurrent conversions can further reduce exposure, but these measures are not complete substitutes for upgrading.

Disabling AutolinkExtension and avoiding GithubFlavoredMarkdownExtension removes the autolink-specific trigger, but the core multibyte parsing paths remain reachable in the standard parser. Existing nesting, delimiter, raw-HTML, and unsafe-link configuration options do not eliminate all affected paths. Applications that must continue processing untrusted Markdown should therefore enforce input limits even when autolinking is disabled.

AnalysisAI

Quadratic-time denial of service in league/commonmark versions 0.6.0 through 2.8.3 allows remote unauthenticated attackers to exhaust PHP worker processes by submitting a single specially crafted Markdown line. The root cause is a character-vs-byte position mismatch in the UTF-8-aware parser: lines containing non-ASCII characters trigger repeated full-line rescans that scale as O(n²) with line length, and a second independent quadratic path exists in the AutolinkExtension. No public exploit code or active exploitation (CISA KEV) has been identified at time of analysis, but the attack fits within a single HTTP request and requires no authentication, making it operationally straightforward once the pattern is known.

Technical ContextAI

league/commonmark (CPE: pkg:composer/league/commonmark) is the de facto PHP implementation of the CommonMark Markdown specification, used widely across PHP applications and frameworks. CWE-407 (Inefficient Algorithmic Complexity) describes the root cause precisely: the parser internally tracks positions as character indices, but PHP's regular-expression engine reports byte offsets. For ASCII-only text these are identical, but any UTF-8 multibyte character causes them to diverge. Prior to 2.9.0, the parser resolved this divergence by calling mb_substr() from the start of the line on every character-to-byte lookup, turning each lookup into O(n) work and making a full-line scan O(n²). A second independent quadratic path existed in UrlAutolinkParser, which extracted and re-validated the entire remaining line suffix against a Unicode-mode regex at every URL-like prefix, even on ASCII-only input. The 2.9.0 fix introduces an incremental byteMap lookup table (amortized O(1) per lookup) and anchors the autolink regex to the current byte offset within the original line string, eliminating both quadratic paths while preserving all existing Markdown output and configuration behavior.

RemediationAI

Upgrade league/commonmark to version 2.9.0 or later via Composer (composer require league/commonmark:^2.9.0); this is the vendor-confirmed fix. Patch commits are available at https://github.com/thephpleague/commonmark/commit/a6ef6cdc308dfa39a34239c35818e75892a0e6a8 and https://github.com/thephpleague/commonmark/commit/a70979ea0d7d3377bd7127536748454a922bf5eb. If an immediate upgrade is not feasible, enforce a strict per-line length limit on all Markdown input before passing it to the converter (e.g., reject or truncate any single line exceeding a context-appropriate character threshold such as 1,000-2,000 characters), because every documented trigger fits within one long line and total request-size caps alone do not prevent the attack. Disabling AutolinkExtension and avoiding GithubFlavoredMarkdownExtension removes the URL-prefix quadratic path, but the core multibyte parsing paths in the standard Cursor class remain active and cannot be disabled through configuration settings - this workaround is therefore partial. Applying PHP execution time limits (max_execution_time), rate-limiting the Markdown conversion endpoint, and restricting concurrent PHP-FPM worker slots can reduce blast radius but are not complete substitutes for upgrading. The html_input and allow_unsafe_links settings have no effect on this vulnerability.

More in PHP

View all
CVE-2019-11043 CRITICAL POC
9.8 Oct 28

In PHP versions 7.1.x below 7.1.33, 7.2.x below 7.2.24 and 7.3.x below 7.3.11 in certain configurations of FPM setup it

CVE-2012-1823 CRITICAL POC
9.8 May 11

sapi/cgi/cgi_main.c in PHP before 5.3.12 and 5.4.x before 5.4.2, when configured as a CGI script (aka php-cgi), does not

CVE-2016-1555 CRITICAL POC
9.8 Apr 21

(1) boardData102.php, (2) boardData103.php, (3) boardDataJP.php, (4) boardDataNA.php, and (5) boardDataWW.php in Netgear

CVE-2018-11138 CRITICAL POC
9.8 May 31

The '/common/download_agent_installer.php' script in the Quest KACE System Management Appliance 8.0.318 is accessible by

CVE-2024-11680 CRITICAL POC
9.8 Nov 26

ProjectSend versions prior to r1720 are affected by an improper authentication vulnerability. Rated critical severity (C

CVE-2025-49113 CRITICAL POC
9.9 Jun 02

Roundcube Webmail contains a critical PHP object deserialization vulnerability (CVE-2025-49113, CVSS 9.9) that allows au

CVE-2017-9841 CRITICAL POC
9.8 Jun 27

Util/PHP/eval-stdin.php in PHPUnit before 4.8.28 and 5.x before 5.6.3 allows remote attackers to execute arbitrary PHP c

CVE-2025-0108 HIGH POC
8.8 Feb 12

Palo Alto Networks PAN-OS management web interface contains an authentication bypass allowing unauthenticated attackers

CVE-2021-25298 HIGH POC
8.8 Feb 15

Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re

CVE-2021-25296 HIGH POC
8.8 Feb 15

Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re

CVE-2013-4983 CRITICAL POC
10.0 Sep 10

The get_referers function in /opt/ws/bin/sblistpack in Sophos Web Appliance before 3.7.9.1 and 3.8 before 3.8.1.1 allows

CVE-2023-6553 CRITICAL POC
9.8 Dec 15

The Backup Migration plugin for WordPress is vulnerable to Remote Code Execution in all versions up to, and including, 1

Share

CVE-2026-71488 vulnerability details – vuln.today

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy