markdown-it
Ecosystem: npm
Downloads: 128.26 Mln
- 0CriticalAffects 0 versions
- 3HighAffects 5 versions
- 0MediumAffects 0 versions
- 4ModerateAffects 5 versions
- 1LowAffects 2 versions
- Critical0 (0.0%)
- High3 (37.5%)
- Medium0 (0.0%)
- Moderate4 (50.0%)
- Low1 (12.5%)
Monthly breakdown
- Critical
- High
- Medium
- Moderate
- Low
- 3 vulnerabilities
- Critical: 0
- High: 2
- Medium: 0
- Moderate: 0
- Low: 1
- 1 vulnerabilities
- Critical: 0
- High: 0
- Medium: 0
- Moderate: 1
- Low: 0
- 1 vulnerabilities
- Critical: 0
- High: 0
- Medium: 0
- Moderate: 1
- Low: 0
- 1 vulnerabilities
- Critical: 0
- High: 0
- Medium: 0
- Moderate: 1
- Low: 0
- 1 vulnerabilities
- Critical: 0
- High: 1
- Medium: 0
- Moderate: 0
- Low: 0
- 1 vulnerabilities
- Critical: 0
- High: 0
- Medium: 0
- Moderate: 1
- Low: 0
Vulnerabilities (8)
Known vulnerabilities affecting markdown-it, based on data from OSV.
| ID | Severity | Summary | Affected versions | Published | Source |
|---|---|---|---|---|---|
| GHSA-gfr2-rv44-r23c | High | markdown-it: Quadratic-time rendering of a single multi-line link reference definition with default options (regression since 14.0)### Summary A link reference definition whose label or title is never closed is O(n²) in markdown-it 15.0.2 with default options. Continuation lines are pulled lazily with str += lineContent in src/rules_block/reference.ts, and the subsequent charCodeAt and slice calls flatten the V8 cons-string, copying everything collected so far; this runs before the rule decides the definition is invalid. It is a regression introduced by PR #1004 in 14.0.0: 13.0.2 processed a 313 KB input in 125 ms, while every version since takes about 11 seconds on the same input. At the sizes below, 200 KB takes 3.6 se |
| GitHub (opens in a new tab) | |
| GHSA-r7fv-28h4-cvq7 | High | markdown-it: Quadratic complexity in smartquotes with unmatched closing quotes### 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 } fr |
| GitHub (opens in a new tab) | |
| GHSA-vfgh-jcmw-g37q | Low | markdown-it: Quadratic-time denial of service in inline HTML parsing with html enabled### Summary With `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[`). An 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. The issue was reported against the published `markdown-it@15.0.2` package on Node.js 20 and reproduced on the current source with Node. |
| GitHub (opens in a new tab) | |
| GHSA-253c-mchw-3w2r | Moderate | markdown-it linkify: true has two quadratic paths, so a few hundred KB of markdown blocks the event loop for tens of seconds## Summary Two independent quadratic paths in the `linkify: true` handling. Both are in markdown-it's own code rather than in linkify-it, which stays linear on both payloads. `src/rules_core/linkify.ts` calls `arrayReplaceAt` once per linkified text token, and that rebuilds the whole `children` array each time. A paragraph of N soft-broken lines is one inline token with about 2N children, so you get N rebuilds over a 2N array. Schema-less emails are what reach it. A `http://` link gets consumed by the inline rule first and never arrives as a text token, so those stay linear. `src/rules_inli |
| GitHub (opens in a new tab) | |
| GHSA-6v5v-wf23-fmfq | Moderate | markdown-it: Quadratic complexity DoS in smartquotes rule via replaceAt string operations### Summary A 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. ### Details The vulnerability is in the `replaceAt()` helper function used by the smartquotes rule in `lib/rules_core/smartquotes.mjs`: ```javascript function replaceAt (str, index, ch) { return str.slice(0, index) + ch + str.slice(index + 1) } ``` When markdown-it processes a text toke |
| GitHub (opens in a new tab) | |
| GHSA-38c4-r59v-3vqw | Moderate | markdown-it is has a Regular Expression Denial of Service (ReDoS)Versions of the package markdown-it from 13.0.0 and before 14.1.1 are vulnerable to Regular Expression Denial of Service (ReDoS) due to the use of the regex /\*+$/ in the linkify function. An attacker can supply a long sequence of * characters followed by a non-matching character, which triggers excessive backtracking and may lead to a denial-of-service condition. |
| GitHub (opens in a new tab) | |
| GHSA-j5p7-jf4q-742q | High | markdown-it vulnerable to Inefficient Regular Expression ComplexityA vulnerability was found in markdown-it up to 2.x. It has been classified as problematic. Affected is an unknown function of the file `lib/common/html_re.js`. The manipulation leads to inefficient regular expression complexity. Upgrading to version 3.0.0 is able to address this issue. The name of the patch is 89c8620157d6e38f9872811620d25138fc9d1b0d. It is recommended to upgrade the affected component. The identifier of this vulnerability is VDB-216852. |
| GitHub (opens in a new tab) | |
| GHSA-6vfc-qv3f-vr6c | Moderate | Uncontrolled Resource Consumption in markdown-it### Impact Special patterns with length > 50K chars can slow down parser significantly. ```js const md = require('markdown-it')(); md.render(`x ${' '.repeat(150000)} x \nx`); ``` ### Patches Upgrade to v12.3.2+ ### Workarounds No. ### References Fix + test sample: https://github.com/markdown-it/markdown-it/commit/ffc49ab46b5b751cd2be0aabb146f2ef84986101 |
| GitHub (opens in a new tab) |
- GHSA-gfr2-rv44-r23cHighmarkdown-it: Quadratic-time rendering of a single multi-line link reference definition with default options (regression since 14.0)
>= 14.1.0, < 14.3.3>= 15.0.0, < 15.0.3
### Summary A link reference definition whose label or title is never closed is O(n²) in markdown-it 15.0.2 with default options. Continuation lines are pulled lazily with str += lineContent in src/rules_block/reference.ts, and the subsequent charCodeAt and slice calls flatten the V8 cons-string, copying everything collected so far; this runs before the rule decides the definition is invalid. It is a regression introduced by PR #1004 in 14.0.0: 13.0.2 processed a 313 KB input in 125 ms, while every version since takes about 11 seconds on the same input. At the sizes below, 200 KB takes 3.6 se
CVE: CVE-2026-111758
- GHSA-r7fv-28h4-cvq7Highmarkdown-it: Quadratic complexity in smartquotes with unmatched closing quotes
>= 15.0.0, < 15.0.2< 14.3.2
### 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 } fr
CVE: CVE-2026-111759
- GHSA-vfgh-jcmw-g37qLowmarkdown-it: Quadratic-time denial of service in inline HTML parsing with html enabled
< 14.3.3>= 15.0.0, < 15.0.3
### Summary With `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[`). An 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. The issue was reported against the published `markdown-it@15.0.2` package on Node.js 20 and reproduced on the current source with Node.
CVE: CVE-2026-111766
- GHSA-253c-mchw-3w2rModeratemarkdown-it linkify: true has two quadratic paths, so a few hundred KB of markdown blocks the event loop for tens of seconds
>= 15.0.0, < 15.0.1< 14.3.1
## Summary Two independent quadratic paths in the `linkify: true` handling. Both are in markdown-it's own code rather than in linkify-it, which stays linear on both payloads. `src/rules_core/linkify.ts` calls `arrayReplaceAt` once per linkified text token, and that rebuilds the whole `children` array each time. A paragraph of N soft-broken lines is one inline token with about 2N children, so you get N rebuilds over a 2N array. Schema-less emails are what reach it. A `http://` link gets consumed by the inline rule first and never arrives as a text token, so those stay linear. `src/rules_inli
- GHSA-6v5v-wf23-fmfqModeratemarkdown-it: Quadratic complexity DoS in smartquotes rule via replaceAt string operations
< 14.2.0
### Summary A 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. ### Details The vulnerability is in the `replaceAt()` helper function used by the smartquotes rule in `lib/rules_core/smartquotes.mjs`: ```javascript function replaceAt (str, index, ch) { return str.slice(0, index) + ch + str.slice(index + 1) } ``` When markdown-it processes a text toke
CVE: CVE-2026-48988
- GHSA-38c4-r59v-3vqwModeratemarkdown-it is has a Regular Expression Denial of Service (ReDoS)
>= 13.0.0, < 14.1.1
Versions of the package markdown-it from 13.0.0 and before 14.1.1 are vulnerable to Regular Expression Denial of Service (ReDoS) due to the use of the regex /\*+$/ in the linkify function. An attacker can supply a long sequence of * characters followed by a non-matching character, which triggers excessive backtracking and may lead to a denial-of-service condition.
CVE: CVE-2026-2327
- GHSA-j5p7-jf4q-742qHighmarkdown-it vulnerable to Inefficient Regular Expression Complexity
< 3.0.0
A vulnerability was found in markdown-it up to 2.x. It has been classified as problematic. Affected is an unknown function of the file `lib/common/html_re.js`. The manipulation leads to inefficient regular expression complexity. Upgrading to version 3.0.0 is able to address this issue. The name of the patch is 89c8620157d6e38f9872811620d25138fc9d1b0d. It is recommended to upgrade the affected component. The identifier of this vulnerability is VDB-216852.
CVE: CVE-2015-10005
- GHSA-6vfc-qv3f-vr6cModerateUncontrolled Resource Consumption in markdown-it
< 12.3.2
### Impact Special patterns with length > 50K chars can slow down parser significantly. ```js const md = require('markdown-it')(); md.render(`x ${' '.repeat(150000)} x \nx`); ``` ### Patches Upgrade to v12.3.2+ ### Workarounds No. ### References Fix + test sample: https://github.com/markdown-it/markdown-it/commit/ffc49ab46b5b751cd2be0aabb146f2ef84986101
CVE: CVE-2022-21670