Skip to main content

markdown-it: Quadratic-time rendering of a single multi-line link reference definition with default options (regression since 14.0) (CVE-2026-111758)

0
High
Published: 10/20/2026 (10/20/2026, 20:28:44 UTC)
Source: GCVE Database
Product: markdown-it

Description

markdown-it versions 14.1.0 through before 14.3.3 and 15.0.0 through before 15.0.3 contain a regression causing quadratic-time complexity when rendering a single multi-line link reference definition with default options. This results in severe performance degradation, blocking the Node.js event loop for many seconds on large inputs. The issue arises from inefficient string concatenation and parsing logic in the reference rule, leading to an algorithmic complexity denial of service (CWE-407).

CVSS v3.1

Score 7.5high

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Affected software

npmghsa
markdown-it
Affected versions
>=14.1.0 <14.3.3
npmghsa
markdown-it
Affected versions
>=15.0.0 <15.0.3

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 10/20/2026, 22:42:44 UTC

Technical Analysis

A regression introduced in markdown-it 14.0.0 causes quadratic-time complexity (O(n²)) when processing a link reference definition whose label or title is never closed. The root cause is the use of string concatenation (str += lineContent) combined with subsequent charCodeAt and slice calls that flatten V8 cons-strings, copying the entire accumulated string repeatedly. This inefficiency leads to exponential increases in processing time as input size grows, with benchmarks showing a 313 KB input taking 11 seconds versus 125 ms in version 13.0.2. The vulnerability affects default options and does not require any opt-in. The issue is confirmed by tests disabling the reference rule or inline parsing, which revert performance to linear. The fix involves tracking positions in the source string rather than concatenating or limiting the scanned label length. Versions affected are >=14.1.0 <14.3.3 and >=15.0.0 <15.0.3.

Potential Impact

This vulnerability enables an attacker to cause a denial of service by submitting specially crafted Markdown input that triggers quadratic-time parsing in markdown-it. The Node.js event loop is blocked for extended periods (e.g., ~18 seconds for 400 KB input, ~74 seconds for 800 KB input), severely degrading service availability. This affects any server rendering user Markdown with markdown-it default options, including comments, issues, chat, wikis, documentation previews, and LLM chat UIs. There is no confidentiality or integrity impact, but availability is significantly affected.

Mitigation Recommendations

A patch is available for this vulnerability. Users should upgrade markdown-it to versions 14.3.3 or later, or 15.0.3 or later, where the issue is fixed. The fix involves changing the parsing logic to avoid inefficient string concatenation and bounding the scanned label length. Until patched, disabling the reference parsing rule or inline parsing can mitigate the issue but may reduce Markdown functionality. No additional generic mitigations are required as the vulnerability is specific to the parsing of unclosed multi-line link reference definitions.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Gcve Source
db.gcve.eu
Osv Id
GHSA-gfr2-rv44-r23c
Osv Schema Version
1.4.0
Aliases
["CVE-2026-111758"]
Ecosystems
["npm"]
Database Specific Severity
HIGH
Cvss Version
3.1

Threat ID: 6ad7ec432cdf04f6566b9ed8

Added to database: 10/20/2026, 22:33:39 UTC

Last enriched: 10/20/2026, 22:42:44 UTC

Last updated: 10/20/2026, 22:42:44 UTC

Views: 2

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses