Junglewise Threat Intelligence

Acorn regular expression denial of service

Severity: low · CVSS 3.1 · Published 2020-04-03

Executive brief

Acorn is a popular JavaScript parser used by many build tools and development environments. A malicious regular expression pattern can cause the parser to enter an infinite loop, consuming CPU and halting processing. An application that processes untrusted JavaScript code without proper validation could be rendered unavailable.

Technical details

The vulnerability is a Regular Expression Denial of Service (ReDoS) in Acorn's regexp validator. A crafted regex pattern in the form of /[x-\ud800]/u (containing invalid UTF-16 surrogate pairs) causes the parser to enter an infinite loop during validation. The attack requires passing untrusted input directly to Acorn's parser, as invalid UTF-16 strings are normally sanitized. The vulnerability affects Acorn versions 5.5.0–5.7.3, 6.0.0–6.4.0, and 7.0.0–7.1.0, with fixes available in versions 5.7.4, 6.4.1, and 7.1.1 respectively.

Affected products

  • Acorn Acorn 5.5.0–5.7.3, 6.0.0–6.4.0, 7.0.0–7.1.0

Timeline

  • 2020-04-03: disclosed
  • 2020: patched: Fixes released in versions 5.7.4, 6.4.1, and 7.1.1

References