---
id: "CVE-2026-111759"
kind: "vulnerability"
aliases: ["CVE-2026-111759", "GHSA-r7fv-28h4-cvq7"]
title: "markdown-it: Quadratic complexity in smartquotes with unmatched closing quotes"
severity: "high"
cvss: 7.5
epss: 0.005979999899864197
exploited: false
status: "open"
category: "package"
products: [{"name": "markdown-it", "fixed": ["15.0.2"], "affected": ">= 15.0.0, < 15.0.2", "ecosystem": "npm"}, {"name": "markdown-it", "fixed": ["14.3.2"], "affected": "< 14.3.2", "ecosystem": "npm"}]
ecosystems: ["npm"]
tags: ["cwe-400", "cwe-407", "markdown-it", "node.js", "package", "typographer", "untrusted-input"]
not_affected_if: ["default-config", "no-untrusted-markdown", "typographer-disabled"]
published_at: "2026-10-19T18:17:00+00:00"
first_seen_at: "2026-10-23T19:11:32+00:00"
updated_at: "2026-10-23T21:57:18+00:00"
sources: [{"source": "ghsa", "url": "https://github.com/advisories/GHSA-r7fv-28h4-cvq7", "first_seen_at": "2026-10-23T19:11:32+00:00"}, {"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-111759", "first_seen_at": "2026-10-23T21:57:18+00:00"}]
---

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

markdown-it is a JavaScript Markdown parser; with typographer enabled, crafted input with many unmatched quote characters makes the smartquotes rule run in quadratic time. An attacker who can submit Markdown to an application gets a denial of service by tying up CPU during rendering.

_Summary, check and fix written by a model from the sources; labelled as such._

## Affected

- npm:markdown-it affected >= 15.0.0, < 15.0.2 fixed 15.0.2
- npm:markdown-it affected < 14.3.2 fixed 14.3.2

## How to check

Run npm ls markdown-it to find the installed version and check whether typographer: true is set where markdown-it is constructed.
Search the code for 'typographer: true' or 'typographer:true'.

## Fix

Upgrade markdown-it to 15.0.2 (for the 15.x line) or 14.3.2 (for the 14.x line).
As a workaround, set typographer to false or call md.disable('smartquotes').

## Timeline

- 2026-10-23T19:11:32+00:00 ghsa https://github.com/advisories/GHSA-r7fv-28h4-cvq7
- 2026-10-23T21:57:18+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-111759

## From the sources

### 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')
```

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
