CVE-2026-111758: markdown-it: Quadratic-time rendering of a single multi-line link reference definition with default options (regression since 14.0)
A link reference definition whose label or title is never closed is O(n²) in markdown-it 15.0.2 with default options. Continuation lines are pulled lazily with str += lineContent in src/rules_block/reference.ts, and the subsequent charCodeAt and slice calls flatten the V8 cons-string, copying everything collected so far; this runs before the rule decides the definition is invalid. It is a regression introduced by PR #1004 in 14.0.0: 13.0.2 processed a 313 KB input in 125 ms, while every version since takes about 11 seconds on the same input. At the sizes below, 200 KB takes 3.6 seconds, 400 KB takes 18.1 seconds, and 800 KB takes 74.0 seconds, which is roughly 4–5× per doubling. No options are required to trigger it.
References
- github.com/advisories/GHSA-gfr2-rv44-r23c
- github.com/markdown-it/markdown-it/commit/48fbc465812c440020c663f040ab22deaf8f1eca
- github.com/markdown-it/markdown-it/commit/d99f48839d37af6fd8a2617516c43dab90755503
- github.com/markdown-it/markdown-it/releases/tag/14.3.3
- github.com/markdown-it/markdown-it/releases/tag/15.0.3
- github.com/markdown-it/markdown-it/security/advisories/GHSA-gfr2-rv44-r23c
- nvd.nist.gov/vuln/detail/CVE-2026-111758
Code Behaviors & Features
Detect and mitigate CVE-2026-111758 with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →