markdown-it: Quadratic complexity in smartquotes with unmatched closing quotes
High severity
GitHub Reviewed
Published
Sep 12, 2026
in
markdown-it/markdown-it
•
Updated Oct 20, 2026
Package
Affected versions
>= 15.0.0, < 15.0.2
< 14.3.2
Patched versions
15.0.2
14.3.2
Description
Published by the National Vulnerability Database
Oct 19, 2026
Published to the GitHub Advisory Database
Oct 20, 2026
Reviewed
Oct 20, 2026
Last updated
Oct 20, 2026
Impact
When
typographer: trueis 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
Result:
Patches
Fixed in 15.0.2 and 14.3.2.
Workarounds
Disable typography with
typographer: false, or disable only the smartquotes rule:References