CVE-2026-48988
JavaScript vulnerability analysis and mitigation

Overview

CVE-2026-48988 is a denial-of-service vulnerability in the markdown-it Markdown parser caused by quadratic (O(n²)) algorithmic complexity in the smartquotes rule when typographer: true is enabled. It affects all versions of markdown-it up to and including 14.1.1 (npm package). The vulnerability was first published by maintainer puzrin on May 23, 2026, added to the GitHub Advisory Database on June 15, 2026, and assigned CVE-2026-48988 shortly after. It carries a CVSS v3.1 base score of 5.3 (Medium) (Github Advisory, Security Advisory).

Technical details

The root cause is inefficient algorithmic complexity (CWE-407) and uncontrolled resource consumption (CWE-400) in the replaceAt() helper function within lib/rules_core/smartquotes.mjs. When typographer: true is set, the smartquotes rule iterates over each quotation mark in a text token and calls replaceAt(), which performs str.slice(0, index) + ch + str.slice(index + 1) — an O(n) string operation — once per quote character. With n quote characters in a single token, the total complexity becomes O(n²), causing exponential CPU growth for quote-heavy inputs. The attack vector is network-based, requires no authentication or user interaction, and the only precondition is that the target application has typographer: true enabled (which is not the default but is commonly enabled in production). A public PoC demonstrates that 160,000 consecutive double-quote characters cause ~21 seconds of processing time versus ~8ms with typographer disabled (Security Advisory, Fix Commit).

Impact

Successful exploitation causes excessive CPU consumption on the server, degrading or completely disrupting service availability for legitimate users. There is no impact on confidentiality or data integrity — the vulnerability is purely an availability issue. An attacker can submit a relatively small payload (~160KB of quote characters) that ties up server CPU for over 21 seconds per request; repeated submissions can exhaust CPU resources and render the service unresponsive (Security Advisory).

Exploitation steps

  1. Reconnaissance: Identify web applications or APIs that accept user-supplied Markdown input and render it using markdown-it with typographer: true enabled (e.g., comment systems, documentation platforms, chat applications).
  2. Craft the payload: Generate a string consisting of a large number of consecutive double-quote (") or single-quote (') characters. A payload of 160,000 characters (~160KB) is sufficient to cause ~21 seconds of CPU processing per request:
    const payload = '"'.repeat(160000);
  3. Submit the payload: Send the crafted Markdown string to the target application's input endpoint (e.g., via HTTP POST to a comment submission or document rendering API).
  4. Repeat for amplification: Submit multiple concurrent or sequential requests with the same payload to exhaust server CPU resources, preventing legitimate users from being served and causing a denial-of-service condition (Security Advisory).

Indicators of compromise

  • Network: Repeated HTTP requests to Markdown-rendering endpoints containing large bodies composed almost entirely of quote characters (" or '); unusually high request body sizes (~160KB+) to text/content submission endpoints.
  • Logs: Server access logs showing requests to Markdown rendering endpoints with abnormally long processing times (seconds per request); elevated error rates or timeouts on content submission endpoints.
  • Process: Sustained high CPU utilization on the Node.js process hosting the markdown-it application, particularly correlated with incoming requests to content rendering endpoints; CPU spikes that scale with request volume rather than complexity of rendered output.

Mitigation and workarounds

Upgrade markdown-it to version 14.2.0 or later, which replaces the replaceAt() approach with a batch replacement strategy (addReplacement()/applyReplacements()) that reduces smartquotes processing to O(n) (Fix Commit, Github Advisory). As an immediate workaround for applications that cannot upgrade, disable the typographer option (typographer: false) in the markdown-it configuration — note that this is the default setting, so only explicitly enabled deployments are affected. Additionally, consider implementing input length limits or rate limiting on Markdown rendering endpoints to reduce the attack surface.

Community reactions

The vulnerability was reported by researcher tndud042713 and published by the markdown-it maintainer puzrin directly via GitHub Security Advisories. Detection coverage has been added by Qualys (detection ID 5013791) and Tenable Nessus (plugin 321702), indicating prompt uptake by the vulnerability scanning community (Github Advisory). The issue was also tracked by OSV, ENISA EUVD, and GitLab's advisory database shortly after disclosure, reflecting standard community propagation for a moderate-severity open-source library vulnerability.

Additional resources

  • Security Advisory — Official markdown-it security advisory (GHSA-6v5v-wf23-fmfq)
  • Github Advisory — GitHub Advisory Database entry for CVE-2026-48988
  • Fix Commit — Patch commit replacing replaceAt() with batch replacement
  • Tenable Plugin — Nessus detection plugin for CVE-2026-48988
  • OSV Entry — Open Source Vulnerabilities database entry

SourceThis report was generated using AI

Related JavaScript vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

GHSA-8mv7-9c27-98vcMEDIUM5.1
  • JavaScript logoJavaScript
  • astro
NoYesJul 20, 2026
CVE-2026-59729MEDIUM5.1
  • JavaScript logoJavaScript
  • astro
NoYesJul 20, 2026
CVE-2026-59728MEDIUM4.3
  • JavaScript logoJavaScript
  • @astrojs/rss
NoYesJul 20, 2026
GHSA-hp3v-mfqw-h74cLOW3.7
  • JavaScript logoJavaScript
  • @astrojs/netlify
NoYesJul 20, 2026
CVE-2026-59730LOW2.1
  • JavaScript logoJavaScript
  • @astrojs/node
NoYesJul 20, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management