Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. markdown-it
  4. ›
  5. GHSA-253c-mchw-3w2r

GHSA-253c-mchw-3w2r: markdown-it linkify: true has two quadratic paths, so a few hundred KB of markdown blocks the event loop for tens of seconds

September 29, 2026

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_inline/linkify.ts runs state.pending.match(SCHEME_RE) at every :// in the source. state.pending only gets truncated once a link is actually produced, so an unregistered scheme leaves it growing and every :// rescans the lot.

References

  • github.com/advisories/GHSA-253c-mchw-3w2r
  • github.com/markdown-it/markdown-it/commit/09fa07118dda4c953f058848f53dae88395618ca
  • github.com/markdown-it/markdown-it/commit/aaadcfa6d817b3c5f89afb49d97c7b797a6dd4fd
  • github.com/markdown-it/markdown-it/commit/ad70f6b7cff64bee10e42a774147112480ca0d49
  • github.com/markdown-it/markdown-it/security/advisories/GHSA-253c-mchw-3w2r

Code Behaviors & Features

Detect and mitigate GHSA-253c-mchw-3w2r with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 14.3.1, all versions starting from 15.0.0 before 15.0.1

Fixed versions

  • 14.3.1
  • 15.0.1

Solution

Upgrade to versions 14.3.1, 15.0.1 or above.

Impact 5.3 MEDIUM

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L

Learn more about CVSS

Weakness

  • CWE-400: Uncontrolled Resource Consumption
  • CWE-407: Inefficient Algorithmic Complexity

Source file

npm/markdown-it/GHSA-253c-mchw-3w2r.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Mon, 12 Oct 2026 12:18:50 +0000.