markdown-it denial of service in link reference parsing
markdown-it
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| markdown-it npm |
|
|
Original description
markdown-it is a Markdown parser. From versions 14.1.0 to before 14.3.3, and 15.0.0 to before 15.0.3, a link reference definition whose label or title is never closed is O(n²) 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. No options are required to trigger it. This issue has been patched in versions 14.3.3 and 15.0.3.
From the CVE record · GitHub_M
References
- github.com/markdown-it/markdown-it/security/advisories/GHSA-gfr2-rv44-r23cExploit
- 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/CVEProject/cvelistV5/tree/main/cves/2026/111xxx/CVE-2026-111758.json
- nvd.nist.gov/vuln/detail/CVE-2026-111758
- github.com/markdown-it/markdown-it