Junglewise Threat Intelligence

Marked ReDoS in email address validation

Severity: low · CVSS 3.1 · Published 2019-06-05

Technologies: Marked.

Executive brief

Marked is a popular JavaScript Markdown parser used to convert Markdown text into HTML. The library contained a regular expression that could evaluate email addresses in quadratic time, allowing attackers to cause denial of service by crafting specially malformed input that forces excessive processing and crashes the application or node.js process.

Technical details

The vulnerability is a Regular Expression Denial of Service (ReDoS) flaw in Marked's inline text parsing regex, specifically in email address validation. The regex performed quadratic-time backtracking when processing malformed email-like patterns, causing catastrophic performance degradation. An unauthenticated attacker on the network can send a specially crafted Markdown document containing problematic email address patterns to trigger excessive CPU consumption and crash the node.js process. The vulnerability was fixed in version 0.6.2 by refactoring the regexes to avoid catastrophic backtracking and quadratic scanning behavior.

Affected products

  • Marked marked 0.3.14 to 0.6.1

Timeline

  • 2019-06-05: disclosed

References