Skip to main content

markdown-it linkify: true has two quadratic paths, so a few hundred KB of markdown blocks the event loop for tens of seconds

0
Medium
Published: 09/29/2026 (09/29/2026, 17:57:56 UTC)
Source: GCVE Database
Product: markdown-it

Description

markdown-it versions prior to 15.0.1 and before 14.3.1 have two independent quadratic time complexity paths when the linkify option is enabled. This causes the event loop to be blocked for tens of seconds when processing a few hundred KB of markdown containing many linkifiable tokens, leading to availability degradation. The issue arises from inefficient array rebuilding and repeated regex matching in markdown-it's own code, not in the linkify-it dependency. The vulnerability affects only applications that enable the linkify option, which is off by default.

CVSS v4.0

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
Present
Privileges Required
None
User Interaction
None
Vuln. Confidentiality
None
Vuln. Integrity
None
Vuln. Availability
Low
Subsq. Confidentiality
None
Subsq. Integrity
None
Subsq. Availability
None
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N

Affected software

npmghsa
markdown-it
Affected versions
<14.3.1

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: 09/29/2026, 21:22:42 UTC

Technical Analysis

The markdown-it library has two separate quadratic complexity issues in its linkify: true handling. First, the arrayReplaceAt function is called repeatedly per linkified text token, rebuilding a large children array multiple times, causing O(N^2) behavior when many soft-broken lines are present. Second, a regex match on the input string is performed repeatedly at every '://' occurrence without truncation unless a link is produced, causing repeated rescanning and further quadratic complexity. These inefficiencies cause the event loop to be blocked for tens of seconds on inputs of a few hundred KB, severely impacting availability. The problem is in markdown-it's own code, not in the linkify-it dependency, and only affects usage with linkify enabled.

Potential Impact

This vulnerability causes significant availability degradation by blocking the Node.js event loop for tens of seconds when processing markdown inputs of a few hundred KB with linkify enabled. The blocking time grows quadratically with input size, making the application unresponsive during processing. There is no impact on confidentiality, integrity, or code execution. The issue only affects applications that explicitly enable the linkify option, which is off by default.

Mitigation Recommendations

A patch is available for this vulnerability. Users should upgrade markdown-it to version 15.0.1 or later, or any version after 14.3.1 where this issue is fixed. If upgrading is not immediately possible, disabling the linkify option will avoid the quadratic performance degradation. Since linkify is off by default, applications not enabling it are not affected.

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-253c-mchw-3w2r
Osv Schema Version
1.4.0
Ecosystems
["npm"]
Database Specific Severity
MODERATE
Cvss Version
4.0

Threat ID: 6abc27cf680226ef6846f924

Added to database: 09/29/2026, 21:04:15 UTC

Last enriched: 09/29/2026, 21:22:42 UTC

Last updated: 09/30/2026, 03:13:18 UTC

Views: 6

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