{"id":"GHSA-6v5v-wf23-fmfq","revision":null,"records":[{"revision":"743630523d3d4a508301976d752ed1a8","observedAt":"2026-10-23T15:48:27.903+00:00","statement":{"source":"cve-program","id":"CVE-2026-48988","aliases":[],"title":"markdown-it: Quadratic complexity DoS in smartquotes rule via replaceAt string operations","description":"markdown-it is a Markdown parser. Versions 14.1.1 and below contain a denial-of-service vulnerability when typographer: true is enabled, due to quadratic (O(n^2)) processing in the smartquotes rule. The issue stems from repeatedly modifying strings with replaceAt(), which performs O(n) slicing and concatenation per quote character. This can cause excessive CPU consumption when parsing quote-heavy, user-supplied markdown and may let attackers degrade or disrupt service availability. Although typographer is disabled by default, many production apps enable it for smart typography, making the issue relevant. This issue has been fixed in version 14.2.0.","state":0,"publishedAt":"2026-06-17T20:54:06.641+00:00","modifiedAt":"2026-06-18T19:41:43.861+00:00","affected":[{"ecosystem":"Vendor product","name":"markdown-it","ranges":[],"versions":[],"rawVersionEvidence":"{\n                    \"vendor\": \"markdown-it\",\n                    \"product\": \"markdown-it\",\n                    \"versions\": [\n                        {\n                            \"version\": \"< 14.2.0\",\n                            \"status\": \"affected\"\n                        }\n                    ]\n                }"}],"metrics":[{"system":"CVSS 3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","score":5.3,"severity":"MEDIUM"}],"references":["https://github.com/markdown-it/markdown-it/security/advisories/GHSA-6v5v-wf23-fmfq","https://github.com/markdown-it/markdown-it/commit/9ce2087562c45d1e5ddd9f76b990f4b3fbe040e5"],"sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2026-48988","license":"CVE Program Terms of Use","key":"cve-program:CVE-2026-48988","identifiers":["CVE-2026-48988"]},"retained":false,"historicalAffected":[]},{"revision":"6c3ccf83e6c343f5b269936100a66403","observedAt":"2026-11-15T14:51:10.202+00:00","statement":{"source":"euvd","id":"EUVD-2026-37799","aliases":["CVE-2026-48988","GHSA-6v5v-wf23-fmfq"],"title":"markdown-it is a Markdown parser. Versions 14.1.1 and below contain a denial-of-service vulnerability when typographer: true is enabled, due to quadratic (O(n^2)) processing in the smartquotes rule. The issue stems from repeatedly modifying…","description":"markdown-it is a Markdown parser. Versions 14.1.1 and below contain a denial-of-service vulnerability when typographer: true is enabled, due to quadratic (O(n^2)) processing in the smartquotes rule. The issue stems from repeatedly modifying strings with replaceAt(), which performs O(n) slicing and concatenation per quote character. This can cause excessive CPU consumption when parsing quote-heavy, user-supplied markdown and may let attackers degrade or disrupt service availability. Although typographer is disabled by default, many production apps enable it for smart typography, making the issue relevant. This issue has been fixed in version 14.2.0.","state":0,"publishedAt":null,"modifiedAt":null,"affected":[],"metrics":[{"system":"EUVD CVSS 3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","score":5.3,"severity":null}],"references":["https://github.com/markdown-it/markdown-it/security/advisories/GHSA-6v5v-wf23-fmfq","https://github.com/markdown-it/markdown-it/commit/9ce2087562c45d1e5ddd9f76b990f4b3fbe040e5"],"sourceUrl":"https://euvd.enisa.europa.eu/vulnerability/EUVD-2026-37799","license":"ENISA EUVD · source terms and attribution apply","enrichment":{"sourceStatus":null,"weaknesses":[],"productCriteria":[],"sourceDates":{"datePublished":"Jun 17, 2026, 8:54:06 PM","dateUpdated":"Jun 18, 2026, 7:41:43 PM"},"relatedAdvisories":[],"note":"EUVD source date text has no stated timezone and is retained without inventing a UTC instant. Related bulletin membership is not an alias, common cause or applicability claim. A missing vector with a zero score is treated as unrated. Complete vendor/product and underlying source evidence remains in the original JSON."},"key":"euvd:EUVD-2026-37799","identifiers":["EUVD-2026-37799","CVE-2026-48988","GHSA-6v5v-wf23-fmfq"]},"retained":false,"historicalAffected":[]},{"revision":"0bf0de4a68ad4a0ba6659cabc7611178","observedAt":"2026-10-25T12:17:32.273+00:00","statement":{"source":"nvd","id":"CVE-2026-48988","aliases":[],"title":"markdown-it is a Markdown parser. Versions 14.1.1 and below contain a denial-of-service vulnerability when typographer: true is enabled, due to quadratic (O(n^2)) processing in the smartquotes rule. The issue stems from repeatedly modifying…","description":"markdown-it is a Markdown parser. Versions 14.1.1 and below contain a denial-of-service vulnerability when typographer: true is enabled, due to quadratic (O(n^2)) processing in the smartquotes rule. The issue stems from repeatedly modifying strings with replaceAt(), which performs O(n) slicing and concatenation per quote character. This can cause excessive CPU consumption when parsing quote-heavy, user-supplied markdown and may let attackers degrade or disrupt service availability. Although typographer is disabled by default, many production apps enable it for smart typography, making the issue relevant. This issue has been fixed in version 14.2.0.","state":0,"publishedAt":"2026-06-17T21:16:23.563+00:00","modifiedAt":"2026-06-24T19:06:21.497+00:00","affected":[],"metrics":[{"system":"CVSS 3.1 · security-advisories@github.com · Secondary","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","score":5.3,"severity":"MEDIUM"}],"references":["https://github.com/markdown-it/markdown-it/commit/9ce2087562c45d1e5ddd9f76b990f4b3fbe040e5","https://github.com/markdown-it/markdown-it/security/advisories/GHSA-6v5v-wf23-fmfq"],"sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2026-48988","license":"NIST NVD usage terms; underlying source attribution retained","enrichment":{"sourceStatus":"Analyzed","weaknesses":["CWE-400"],"productCriteria":["cpe:2.3:a:markdown-it_project:markdown-it:*:*:*:*:*:*:*:*"],"sourceDates":{"published":"2026-06-17T21:16:23.563","lastModified":"2026-06-24T19:06:21.497"},"relatedAdvisories":[],"note":"NVD analysis and CPE criteria are source context, not proof that a package or your environment is affected. Complete affected data, logical configurations and SSVC are retained in the original JSON."},"key":"nvd:CVE-2026-48988","identifiers":["CVE-2026-48988"]},"retained":false,"historicalAffected":[]},{"revision":"d9b9ef5b10b348b0874c0fae051b0799","observedAt":"2026-10-24T13:17:17.793+00:00","statement":{"source":"osv","id":"GHSA-6v5v-wf23-fmfq","aliases":["CVE-2026-48988"],"title":"markdown-it: Quadratic complexity DoS in smartquotes rule via replaceAt string operations","description":"### Summary\n\nA quadratic time complexity vulnerability exists in markdown-it's smartquotes rule (enabled via the `typographer: true` option). An attacker can craft a markdown input consisting of consecutive quotation marks that causes the parser to consume excessive CPU time, leading to denial of service.\n\n### Details\n\nThe vulnerability is in the `replaceAt()` helper function used by the smartquotes rule in `lib/rules_core/smartquotes.mjs`:\n\n```javascript\nfunction replaceAt (str, index, ch) {\n  return str.slice(0, index) + ch + str.slice(index + 1)\n}\n```\n\nWhen markdown-it processes a text token containing many quotation marks (either `\"` or `'`) with `typographer: true`, the smartquotes rule iterates through each quote character and calls `replaceAt()` to substitute it with a typographic (curly) quote. Each call to `replaceAt()` creates three new string slices and concatenates them, which is an O(n) operation where n is the length of the string.\n\nSince this is called once per quote character in the token, and there are n quote characters, the total time complexity becomes O(n^2).\n\nThe root cause is that the smartquotes rule modifies `token.content` in place using string slicing rather than building the result incrementally. The `process_inlines()` function (line 14) processes each quote in the text token, and for matching quote pairs, calls `replaceAt()` on both the opening and closing token's content (lines 151-152). When the entire input is a single text token of quote characters, this results in quadratic behavior.\n\n### PoC\n\n```javascript\nconst md = require('markdown-it');\nconst instance = md({ typographer: true });\n\n// 160,000 consecutive double-quote characters\nconst payload = '\"'.repeat(160000);\n\nconsole.time('render');\ninstance.render(payload);\nconsole.timeEnd('render');\n// Output: render: ~21000ms (21 seconds)\n\n// Compare with typographer disabled:\nconst safe = md({ typographer: false });\nconsole.time('render-safe');\nsafe.render(payload);\nconsole.timeEnd('render-safe');\n// Output: render-safe: ~8ms\n```\n\nMeasured timing on a modern system:\n- 10,000 quotes: ~19ms\n- 20,000 quotes: ~51ms\n- 40,000 quotes: ~212ms\n- 80,000 quotes: ~5,430ms\n- 160,000 quotes: ~21,198ms\n\nThe scaling is clearly superlinear (quadratic), with the 80K->160K step showing a ~3.9x increase for a 2x input increase, consistent with O(n^2).\n\n### Impact\n\nApplications that render user-supplied markdown with `typographer: true` are vulnerable to denial of service. An attacker can submit a relatively small payload (160KB of quote characters) that causes the server to spend over 21 seconds processing a single request. Repeated submissions can exhaust server CPU resources and prevent legitimate users from being served.\n\nThe impact is mitigated by the fact that the `typographer` option defaults to `false` and must be explicitly enabled. However, the typographer feature is commonly enabled in production applications that want smart typography, and the markdown-it documentation prominently suggests enabling it.\n\nA suggested fix would be to replace the `replaceAt()` approach with an array-based or StringBuilder-style approach that collects all replacements and applies them in a single pass, reducing the time complexity to O(n).","state":0,"publishedAt":"2026-06-15T20:41:06+00:00","modifiedAt":"2026-09-10T03:51:08.0741073+00:00","affected":[{"ecosystem":"npm","name":"markdown-it","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"14.2.0"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V3","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"MODERATE"}],"references":["https://github.com/markdown-it/markdown-it/security/advisories/GHSA-6v5v-wf23-fmfq","https://github.com/markdown-it/markdown-it"],"sourceUrl":"https://github.com/advisories/GHSA-6v5v-wf23-fmfq","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-6v5v-wf23-fmfq","identifiers":["GHSA-6v5v-wf23-fmfq","CVE-2026-48988"]},"retained":false,"historicalAffected":[]}],"coverage":[{"source":"cisa-kev:global","scope":"Complete CISA KEV catalog; all vendors. Missing entries do not establish absence of exploitation.","generation":"2026-11-16T06:32:49.0909253+00:00","complete":true,"records":1781,"lastAttemptAt":"2026-11-16T06:32:49.0909253+00:00","lastSuccessAt":"2026-11-16T06:32:49.2385546+00:00","error":null,"lastVerifiedAt":"2026-11-16T06:32:49.2385553+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"cve-program","scope":"Official CVE Program baseline and cumulative hourly delta; all vendors, published and rejected records","generation":"cve-6be044d0e08779dadd136f949a536de4047af96f5d7bceb7e190ecffbb8f18ca-abde759308377e81e6df4bcf26cc321fb83732781fbebab464d4068d744d1a38","complete":true,"records":425880,"lastAttemptAt":"2026-11-16T06:30:42.3104975+00:00","lastSuccessAt":"2026-11-16T05:30:47.3761859+00:00","error":null,"lastVerifiedAt":"2026-11-16T06:30:42.3104975+00:00","snapshotPublishedAt":"2026-11-16T05:25:11+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"euvd","scope":"Rolling EUVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global EUVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-77cc6fd02adc466e81e402fc79a7ebc0","complete":false,"records":13821,"lastAttemptAt":"2026-11-16T06:43:34.3008175+00:00","lastSuccessAt":"2026-11-16T06:43:33.269+00:00","error":"174 identifier lookups failed; latest failures include AccessDenied (HTTP 403). Other identifiers were checked independently.","lastVerifiedAt":"2026-11-16T06:43:33.269+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13700,"expectedIdentifiers":13874,"failedIdentifiers":174},{"source":"first-epss:nuget","scope":"FIRST EPSS for explicit CVE aliases in the collected public NuGet archive. Not a global EPSS backfill.","generation":"2026-11-16T06:32:49.0909253+00:00","complete":true,"records":1125,"lastAttemptAt":"2026-11-16T06:32:49.0909253+00:00","lastSuccessAt":"2026-11-16T06:32:49.2393398+00:00","error":null,"lastVerifiedAt":"2026-11-16T06:32:49.23934+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"nvd","scope":"Rolling NVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global NVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-e13574a553734483a008bcd38cd6b056","complete":false,"records":13833,"lastAttemptAt":"2026-11-16T06:33:51.5767416+00:00","lastSuccessAt":"2026-11-16T06:33:51.573+00:00","error":"200 identifier lookups failed; latest failures include HttpError (HTTP 503). Other identifiers were checked independently.","lastVerifiedAt":"2026-11-16T06:33:51.573+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13674,"expectedIdentifiers":13874,"failedIdentifiers":200},{"source":"osv:Go","scope":"Complete OSV Go ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"go-64eea06dbd27de8464d5dbce1b78cc794cc59e2d901516ae0d3ea76e624cdae0","complete":true,"records":9955,"lastAttemptAt":"2026-11-16T06:32:48.9429524+00:00","lastSuccessAt":"2026-11-14T13:57:23.1208135+00:00","error":null,"lastVerifiedAt":"2026-11-16T06:32:48.9429524+00:00","snapshotPublishedAt":"2026-11-14T13:17:57+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:NuGet","scope":"Complete OSV NuGet ecosystem archive, including GitHub Advisory Database records; NuGet version matching only","generation":"nuget-f4424d7d4861b1af1404bd15abcb83f295dcd003412a9340ca99dc8200aa148a","complete":true,"records":2014,"lastAttemptAt":"2026-11-16T06:30:42.4706183+00:00","lastSuccessAt":"2026-11-13T19:57:08.2864435+00:00","error":null,"lastVerifiedAt":"2026-11-16T06:30:42.4706183+00:00","snapshotPublishedAt":"2026-11-13T19:33:10+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:crates.io","scope":"Complete OSV crates.io ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"crates.io-6086d649bcb454cdf302d7d9275177bda73550e1b6e446b3520e9b6266d3582c","complete":true,"records":3148,"lastAttemptAt":"2026-11-16T06:32:49.0470734+00:00","lastSuccessAt":"2026-11-15T11:05:17.1034234+00:00","error":null,"lastVerifiedAt":"2026-11-16T06:32:49.0470734+00:00","snapshotPublishedAt":"2026-11-15T10:03:04+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:npm","scope":"Complete OSV npm ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"npm-297b66f87afd66ce0c02547a007d4571597ddb0db63804850b3bb5664821bafa","complete":true,"records":232482,"lastAttemptAt":"2026-11-16T06:32:48.8045294+00:00","lastSuccessAt":"2026-11-16T06:32:47.3486736+00:00","error":null,"lastVerifiedAt":"2026-11-16T06:32:48.8045294+00:00","snapshotPublishedAt":"2026-11-16T05:48:23+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null}]}