Advisory Database
  • Advisories
  • Dependency Scanning
  1. composer
  2. ›
  3. league/commonmark
  4. ›
  5. GHSA-jfm3-95jq-q3rf

GHSA-jfm3-95jq-q3rf: league/commonmark: Denial of service via duplicate footnote definitions

August 6, 2026

The Footnote extension records one backref per footnote reference and then appends the entire backref list for every footnote definition block in the document, without ever de-duplicating or removing repeated definitions of the same label (GatherFootnotesListener, populated by NumberFootnotesListener). A document that references a single label N times and also supplies N duplicate [^a]: definitions of that label therefore produces N × N FootnoteBackref nodes, so output size, parse time, and peak memory are all O(N²).

Reaching the vulnerable path requires FootnoteExtension to be registered on the Environment. This is opt-in, but is a commonly enabled GFM-style feature; no other non-default configuration is required. An unauthenticated attacker can expand a ~10 KB request into a ~62 MB HTML response, ~3 s of CPU, and ~440 MB of peak memory — enough to OOM-kill a default 128 MB PHP worker and deny service. Availability impact only; no confidentiality or integrity effect. The Footnote extension was introduced in 1.5.0 (May 2020) with this backref logic present from the first commit, so all releases from 1.5.0 onward (including every 2.x through 2.8.x) are affected.

References

  • github.com/advisories/GHSA-jfm3-95jq-q3rf
  • github.com/thephpleague/commonmark/commit/66028124a17ba193da7b11cc3dfda92df21bfbf4
  • github.com/thephpleague/commonmark/releases/tag/2.9.0
  • github.com/thephpleague/commonmark/security/advisories/GHSA-jfm3-95jq-q3rf

Code Behaviors & Features

Detect and mitigate GHSA-jfm3-95jq-q3rf with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions starting from 1.5.0 before 2.9.0

Fixed versions

  • 2.9.0

Solution

Upgrade to version 2.9.0 or above.

Impact 7.5 HIGH

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Learn more about CVSS

Weakness

  • CWE-407: Inefficient Algorithmic Complexity

Source file

packagist/league/commonmark/GHSA-jfm3-95jq-q3rf.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sat, 08 Aug 2026 00:19:23 +0000.