CVE-2019-25102: simple-markdown regular expression denial of service

CVE-2019-25102 · Severity: low · CVSS 3.1 · Published 2023-02-12

simple-markdown is a JavaScript library for parsing Markdown content. A regular expression in the autolink parsing logic is vulnerable to denial of service through specially crafted input patterns, where a 5KB malicious document could take over 7 seconds to parse, consuming CPU resources and disrupting service availability.

Technologies: simple-markdown (npm). Vendors: npm.

Quick answers

Is CVE-2019-25102 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2019-25102 being exploited in the wild.
How severe is CVE-2019-25102?
Low severity, with a CVSS score of 3.1, published 12 February 2023.
Which products and versions are affected?
simple-markdown (npm) SEMVER:introduced=0,fixed=0.6.1.
Is there a fix for CVE-2019-25102?
Yes. simple-markdown (npm): upgrade to 0.6.1 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2019-25102 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2019-25102?
Check whether you run simple-markdown (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

  • simple-markdown (npm): upgrade to 0.6.1 or later
    npm install simple-markdown@0.6.1

Technical details

The vulnerability is a Regular Expression Denial of Service (ReDoS) in the autolink pattern matching of simple-markdown.js, caused by inefficient regex complexity (O(n³) in affected versions). The vulnerable pattern fails to properly handle malformed input like "<<<<<<<<<<:/:/:/:/:/:/:/:/:/:/" which triggers catastrophic backtracking. The attack is remotely exploitable without authentication or user interaction—any attacker who can provide markdown input to an application using simple-markdown can trigger excessive CPU consumption. The vulnerability was fixed in version 0.6.1 (commit 015a719bf5cdc561feea05500ecb3274ef609cd2) by refactoring the autolink regex to reduce complexity from O(n³) to O(n²).

Affected products

  • simple-markdown simple-markdown 0.6.0 and prior; fixed in 0.6.1

Identifiers

  • CVE-2019-25102
  • GHSA-j533-2g8v-pmpg

Timeline

  • 2019-09: disclosed: Public GitHub PR disclosure
  • 2019-09-26: patched: Fix merged in commit 015a719bf5cdc561feea05500ecb3274ef609cd2
  • 2023-02-12: advisory: GitHub advisory GHSA-j533-2g8v-pmpg published

References

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