marked regular expression denial of service

Severity: info · Published 2020-09-03

marked is a popular JavaScript library for parsing and rendering Markdown content. A regular expression flaw in the library can cause severe performance degradation when processing malformed Markdown input, potentially slowing or blocking legitimate document processing.

Technologies: marked (npm). Vendors: npm.

Quick answers

Is This vulnerability exploited in the wild?
No. Junglewise Threat Intelligence has no report of This vulnerability being exploited in the wild.
How severe is This vulnerability?
Informational severity, published 3 September 2020.
Which products and versions are affected?
marked (npm) SEMVER:introduced=0.4.0,fixed=0.7.0.
Is there a fix for This vulnerability?
Yes. marked (npm): upgrade to 0.7.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is This vulnerability attacked?
It is attacked over the network, in a software library.
Am I affected?
Check whether you run marked (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • marked (npm): upgrade to 0.7.0 or later
    npm install marked@0.7.0

Technical details

This vulnerability is a Regular Expression Denial of Service (ReDoS) flaw in marked's _label subrule. The affected regex pattern exhibits catastrophic backtracking when processing specially crafted or malformed Markdown input, causing exponential performance degradation. The vulnerability affects marked versions 0.4.0 through 0.6.x; it requires only network-reachable input (no authentication) and can be triggered by sending a single malicious Markdown string. An attacker can exhaust CPU resources and degrade or block parsing of legitimate documents. The fix is available in version 0.7.0 and later.

Affected products

  • marked marked 0.4.0 to 0.6.x

Timeline

  • 2020-09-03: disclosed

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.