CVE-2021-21317: uap-core regular expression denial of service

CVE-2021-21317 · Severity: low · CVSS 3.1 · Published 2021-02-02

uap-core is a library used to parse and identify user agent strings in web requests. A regular expression vulnerability allows attackers to craft malicious User-Agent headers that cause the parser to consume excessive CPU and hang, disrupting service availability for all users of affected applications.

Technologies: uap-core (npm). Vendors: npm.

Quick answers

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

  • uap-core (npm): upgrade to 0.11.0 or later
    npm install uap-core@0.11.0

Technical details

The vulnerability is a regular expression denial of service (REDoS) attack caused by overlapping capture groups in regex patterns used to parse User-Agent headers. An attacker can send HTTP requests with specially crafted long User-Agent strings to trigger catastrophic backtracking in the regex engine. This is a network-accessible vulnerability requiring no authentication or user interaction. Successful exploitation results in CPU exhaustion and denial of service. The fix is available in uap-core version 0.11.0 and later.

Affected products

  • ua-parser uap-core <0.11.0

Identifiers

  • CVE-2021-21317
  • GHSA-p4pj-mg4r-x6v4

Timeline

  • 2021-01-30: disclosed
  • 2021-02-02: patched: Version 0.11.0 released

References

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