High

markdown-it: Quadratic complexity in smartquotes with unmatched closing quotes

  • Disclosed: 20.10.2026
  • Updated: 20.10.2026 18:18

Impact

When typographer: true is enabled, specially crafted Markdown can cause quadratic processing time in the smartquotes rule, potentially leading to denial of service in applications processing untrusted input.

Many opening double quotes followed by unmatched closing single quotes cause repeated scans of the entire opener stack. The same issue occurs with the quote types reversed.

The default configuration (typographer: false) is not affected, but this option is enabled with high probability.

Reproduction

js
import MarkdownIt from 'markdown-it'
import { performance } from 'node:perf_hooks'

const md = new MarkdownIt({ typographer: true })

for (const k of [2000, 4000, 8000, 16000, 32000]) {
  const input = '"a '.repeat(k) + "b' ".repeat(k)
  const start = performance.now()
  md.render(input)
  console.log(input.length, (performance.now() - start).toFixed(1), 'ms')
}

Result:

input size time
12000 18ms
24000 47ms
48000 115ms
96000 428ms
192000 1586ms

Patches

Fixed in 15.0.2 and 14.3.2.

Workarounds

Disable typography with typographer: false, or disable only the smartquotes rule:

js
md.disable('smartquotes')

What to do

Upgrade to 15.0.2, 14.3.2, or later. If upgrading is not immediately possible, apply the workaround by disabling typography with typographer: false or disabling only the smartquotes rule.

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
npm package markdown-it >= 15.0.0, < 15.0.2, < 14.3.2 15.0.2, 14.3.2

References

CVSS score 7.5/10
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Weakness (CWE)
CWE-400, CWE-407
Platform
npm
Package
markdown-it
Disclosed
20.10.2026
Updated
20.10.2026 18:18

Sources and licenses · Edited or translated by DockRay; source rights and applicable licenses are retained.

OSV / GitHub Advisory Database - GHSA-r7fv-28h4-cvq7 - CC BY 4.0

Vulnerability history: markdown-it

All published vulnerabilities of this package (npm package), newest first. Shows whether this is a one-off slip or a package that needs watching.

Total entries
8
First → latest
01.2022 10.2026
Without a fix
0
Exploited in attacks
0

Severity breakdown

  • High 3
  • Medium 4
  • Low 1

Disclosures per year

  1. 2022: 2
  2. 2023: 0
  3. 2024: 0
  4. 2025: 0
  5. 2026: 6
  1. Low · 3.7 CVE-2026-111766 < 14.3.3, >= 15.0.0, < 15.0.3 14.3.3, 15.0.3
  2. markdown-it: Quadratic complexity in smartquotes with unmatched closing quotes this entry
    High · 7.5 CVE-2026-111759 >= 15.0.0, < 15.0.2, < 14.3.2 15.0.2, 14.3.2
  3. Medium · 5.3 CVE-2026-2327 >= 13.0.0, < 14.1.1 14.1.1
  4. Medium · 5.3 CVE-2022-21670 < 12.3.2 12.3.2

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.