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 25 February 2021.
- Which products and versions are affected?
- marked (npm) SEMVER:introduced=0.5.0,fixed=0.6.1.
- Is there a fix for This vulnerability?
- Yes. marked (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 This vulnerability attacked?
- It is attacked over the network.
- 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.6.1 or later
npm install marked@0.6.1
Technical details
The vulnerability is a Regular Expression Denial of Service (ReDoS) flaw in the hostname regex pattern used by marked's link parsing logic. The vulnerable component processes the "host" variable when parsing link URIs and fails to properly handle nested parentheses, causing catastrophic regex backtracking. An attacker can exploit this by submitting markdown with specially crafted link syntax containing multiple parentheses and link tokens on a single line. No authentication is required; the attack vector is network-based through any application that accepts and processes untrusted markdown input. The issue was fixed in version 0.6.1 by restricting nested parentheses to a single level in link URIs.
Affected products
- marked.js marked 0.5.0 to 0.6.0
Timeline
- 2019-02-21: disclosed
- 2019-01-13: patched: Fix committed upstream; released in version 0.6.1
- 2021-02-25: advisory: GHSA-7m7q-q53v-j47v published