CVE-2026-111766: markdown-it Denial of Service Vulnerability
LOWCVE-2026-111766 is a LOW (CVSS 3.7) denial of service vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting markdown-it libraries in the npm ecosystem. The issue involves quadratic-time denial of service in inline html parsing with html enabled. Remediation is available by upgrading affected packages to version 14.3.3, 15.0.3.
CVE-2026-111766 at a Glance
Security Impact
CVSS: 3.7
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L).
How to Fix CVE-2026-111766
To remediate this vulnerability, upgrade all affected markdown-it dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install markdown-it@14.3.3
npm install markdown-it@15.0.3
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls markdown-it
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2026-111766, inspect your project dependencies using npm:
npm ls markdown-it
Analyze the terminal output to locate any version of markdown-it in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 14.3.3), your application is affected.
Note: The npm ls markdown-it command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. In markdown-it, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-111766 Affected markdown-it Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
markdown-it
|
npm |
< 14.3.3
|
14.3.3
|
|
markdown-it
|
npm |
≥ 15.0.0
< 15.0.3
|
15.0.3
|
References
Frequently Asked Questions
What is CVE-2026-111766?
Which markdown-it versions are affected?
What version fixes CVE-2026-111766?
Is markdown-it affected?
What is the CVSS score of CVE-2026-111766?
What CWE is associated with CVE-2026-111766?
How can I check npm dependencies for CVE-2026-111766?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-vfgh-jcmw-g37q",
"modified" : "2026-10-20T20:08:20Z",
"published" : "2026-10-20T20:08:19Z",
"aliases" : [ "CVE-2026-111766" ],
"summary" : "markdown-it: Quadratic-time denial of service in inline HTML parsing with html enabled",
"details" : "### Summary\n\nWith `html: true`, markdown-it takes quadratic time to parse repeated unterminated HTML constructs inside a paragraph. This affects HTML comments (`<!--`), processing instructions (`<?`), declarations (`<!A`), and CDATA sections (`<![CDATA[`).\n\nAn attacker-controlled input of a few hundred kilobytes can block the Node.js event loop for seconds or tens of seconds. The default configuration has HTML disabled, but the `commonmark` preset enables it.\n\nThe issue was reported against the published `markdown-it@15.0.2` package on Node.js 20 and reproduced on the current source with Node.js 24.16.0.\n\n### Details\n\n`src/rules_inline/text.ts` treats `<` as a terminator, causing the inline parser to attempt the HTML rule at successive HTML construct openers.\n\nWith HTML enabled, `src/rules_inline/html_inline.ts` applies an anchored regular expression to the remaining input:\n\n```js\nconst match = state.src.slice(pos).match(HTML_TAG_RE)\n```\n\nThe comment, processing instruction, declaration, and CDATA alternatives in `src/common/html_re.ts` scan the remaining input for their respective terminators: `-->`, `?>`, `>`, and `]]>`.\n\nWhen the terminator is absent, matching fails. Parsing eventually reaches the next opener and scans an overlapping suffix again. Repeating this across the paragraph produces quadratic total work. For these inputs, the problem is repeated scanning across separate matches.\n\nThe payload must reach inline parsing. Prefixing it with `x ` keeps it inside a paragraph. Starting a line directly with one of these constructs instead invokes HTML block parsing, which does not exhibit the same repeated inline scans for these payloads.\n\nThe existing `unclosed <!--` test in `test/markdown-it/pathological.test.mjs` already contains a reproducer:\n\n```js\n'</' + '<!--'.repeat(100000)\n```\n\nHowever, it runs with default options, where HTML is disabled.\n\nA fix should avoid repeated searches for absent terminators across all four affected alternatives, for example by caching failed searches on the inline state. Fixing only the comment alternative leaves the other three cases affected. Regression coverage should exercise all four with `html: true`.\n\nThe original report was submitted by [@JarLob](https://github.com/JarLob). It credits the [GitHub Security Lab Taskflow Agent](https://github.com/GitHubSecurityLab/seclab-taskflow-agent) as part of the [GitHub Secure Open Source Fund](https://github.com/open-source/github-secure-open-source-fund).\n\n### Proof of concept\n\nInstall the affected package in an empty directory:\n\n```sh\nnpm install markdown-it@15.0.2\n```\n\nSave the following as `poc.mjs` and run `node poc.mjs`:\n\n```js\nimport MarkdownIt from 'markdown-it'\nimport { performance } from 'node:perf_hooks'\n\nconst mdHtml = new MarkdownIt({ html: true })\nconst mdDefault = new MarkdownIt()\nconst sizes = [8000, 16000, 32000, 64000]\n\nfunction measure(md, src) {\n const start = performance.now()\n md.render(src)\n return (performance.now() - start).toFixed(1)\n}\n\nconst variants = {\n comment: '<!--',\n processing: '<?x',\n declaration: '<!A',\n cdata: '<![CDATA['\n}\n\nfor (const [name, opener] of Object.entries(variants)) {\n console.log(`\\n${name}`)\n for (const n of sizes) {\n const src = 'x ' + opener.repeat(n)\n console.log({\n n,\n bytes: Buffer.byteLength(src),\n ms: measure(mdHtml, src)\n })\n }\n}\n\nconst n = sizes.at(-1)\nconst controls = {\n 'HTML disabled': [mdDefault, 'x ' + '<!--'.repeat(n)],\n 'Closed comments': [mdHtml, 'x ' + '<!---->'.repeat(n)],\n 'HTML block': [mdHtml, '<!--'.repeat(n)],\n 'Plain text': [mdHtml, 'x ' + 'abcd'.repeat(n)]\n}\n\nfor (const [name, [md, src]] of Object.entries(controls)) {\n console.log({ control: name, ms: measure(md, src) })\n}\n\nconst repoPayload = '</' + '<!--'.repeat(100000)\nconsole.log({\n payload: 'Existing pathological test',\n htmlFalseMs: measure(mdDefault, repoPayload),\n htmlTrueMs: measure(mdHtml, repoPayload)\n})\n```\n\nMeasurements from the original report on `markdown-it@15.0.2`, Node.js 20:\n\n| Construct | 8,000 repetitions | 64,000 repetitions |\n| --- | ---: | ---: |\n| Comment | 170 ms | 8,799 ms |\n| Processing instruction | 26 ms | 1,566 ms |\n| Declaration | 93 ms | 5,628 ms |\n| CDATA | 119 ms | 4,179 ms |\n\nAn eightfold increase in repetitions produces approximately 35–60 times the execution time, consistent with quadratic growth becoming dominant.\n\nFor the comment payload at 64,000 repetitions:\n\n- HTML disabled: 25 ms.\n- Closed comments: 29 ms.\n- Payload at the start of an HTML block: 1 ms.\n- Plain text: 1 ms.\n\nThe existing pathological-test payload with 100,000 comment openers took 33 ms with HTML disabled and 21,030 ms with HTML enabled. A separate comment payload with 128,000 repetitions, approximately 500 KiB, took 32,847 ms.\n\nExact timings depend on the runtime and hardware.\n\n### Impact\n\nThis is an availability issue affecting applications that render attacker-controlled Markdown with `html: true`, including applications using the `commonmark` preset.\n\nOn Node.js, a synchronous `render()` call can occupy a CPU core and block the event loop for seconds or tens of seconds, delaying other requests handled by the same process. Repeated submissions can cause denial of service. Browser applications can similarly become unresponsive when rendering on the main thread.\n\nSanitizing the generated HTML afterwards does not prevent the issue because the expensive processing occurs during Markdown rendering.\n\nThe default configuration, with HTML disabled, is unaffected by these payloads. Disabling HTML or limiting input size can reduce exposure while a fix is prepared.\n\nThe reported affected release is `15.0.2`; the full affected version range has not been established.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "markdown-it"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "14.3.3"
} ]
} ]
}, {
"package" : {
"ecosystem" : "npm",
"name" : "markdown-it"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "15.0.0"
}, {
"fixed" : "15.0.3"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/markdown-it/markdown-it/security/advisories/GHSA-vfgh-jcmw-g37q"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-111766"
}, {
"type" : "WEB",
"url" : "https://github.com/markdown-it/markdown-it/commit/928bc8c11ded60181c0e7fc5aa954eec582e8e79"
}, {
"type" : "WEB",
"url" : "https://github.com/markdown-it/markdown-it/commit/d99f48839d37af6fd8a2617516c43dab90755503"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/markdown-it/markdown-it"
}, {
"type" : "WEB",
"url" : "https://github.com/markdown-it/markdown-it/releases/tag/14.3.3"
}, {
"type" : "WEB",
"url" : "https://github.com/markdown-it/markdown-it/releases/tag/15.0.3"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-400", "CWE-407" ],
"severity" : "LOW",
"github_reviewed" : true,
"github_reviewed_at" : "2026-10-20T20:08:19Z",
"nvd_published_at" : "2026-10-19T20:17:52Z"
}
}