Inefficient Algorithmic Complexity Affecting league/commonmark package, versions >=1.5.0, <2.10.0


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.49% (40th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-PHP-LEAGUECOMMONMARK-20158925
  • published27 Sept 2026
  • disclosed7 Sept 2026
  • creditmanus-use

Introduced: 7 Sep 2026

CVE-2026-86428  (opens in a new tab)
CWE-407  (opens in a new tab)

How to fix?

Upgrade league/commonmark to version 2.10.0 or higher.

Overview

league/commonmark is a PHP-based Markdown parser which supports the full CommonMark spec. It is based on the CommonMark JS reference implementation.

Affected versions of this package are vulnerable to Inefficient Algorithmic Complexity through the AttributesListener::processDocument() and AttributesBlockContinueParser::tryContinue() paths in src/Extension/Attributes/Event/AttributesListener.php and src/Extension/Attributes/Parser/AttributesBlockContinueParser.php. An attacker can consume excessive CPU and stall PHP workers by sending Markdown with long runs of distinctly named attributes, either as adjacent inline attributes, attribute blocks on consecutive lines, or attribute blocks chained through reference definitions. The extension re-merges and re-filters the growing attribute set on each new attribute node or continuation line, so each added distinct name forces the whole accumulated set to be walked again. In affected applications that register AttributesExtension, this reduces throughput and can prevent legitimate requests from completing.

Workarounds

  • Do not register AttributesExtension when converting untrusted Markdown; this removes the vulnerable attribute-processing paths entirely.
  • If you must keep AttributesExtension enabled, impose a strict maximum input length before conversion so a crafted long run of distinct attributes cannot drive quadratic CPU usage.

CVSS Base Scores

version 4.0
version 3.1