CVE-2021-23362: Regular Expression Denial of Service (ReDoS)

Published Mar 23, 2021
·
Updated

A regular expression denial of service vulnerability was found in hosted-git-info. If an application allows user input into the affected regular expression (regexp) function, shortcutMatch or fromUrl, then an attacker could craft a regexp which takes an ever increasing amount of time to process, potentially resulting in a denial of service.

Other sources

Node.js hosted-git-info module is vulnerable to a denial of service, caused by a regular expression denial of service (ReDoS) flaw in the fromUrl function in index.js. By sending a specially-crafted regex input, a remote attacker could exploit this vulnerability to cause a denial of service condition.

— IBM

The package hosted-git-info before 3.0.8 are vulnerable to Regular Expression Denial of Service (ReDoS) via regular expression shortcutMatch in the fromUrl function in index.js. The affected regular expression exhibits polynomial worst-case time complexity.

The package hosted-git-info before 3.0.8 are vulnerable to Regular Expression Denial of Service (ReDoS) via shortcutMatch in fromUrl().

References:

https://github.com/npm/hosted-git-info/commit/bede0dc38e1785e732bf0a48ba6f81a4a908eba3 https://snyk.io/vuln/SNYK-JAVA-ORGWEBJARSNPM-1088356 https://snyk.io/vuln/SNYK-JS-HOSTEDGITINFO-1088355

Fixed releases : hosted-git-info 3.0.8, hosted-git-info 2.8.9

— Red Hat

This is a vulnerability in the hosted-git-info npm module which may be vulnerable to denial of service attacks.

You can read more about it in https://nvd.nist.gov/vuln/detail/CVE-2021-23362

All versions of the 12.x release line

Versions of the 14.x release line before 14.17.0 which included an update to the latest npm 6.

— Node.Js

Affected Software

13 affected componentsFixes available
redhat/rh-nodejs12-nodejs<0:12.22.2-1.el7
0:12.22.2-1.el7
redhat/rh-nodejs12-nodejs-nodemon<0:2.0.3-2.el7
0:2.0.3-2.el7
redhat/rh-nodejs14-nodejs<0:14.17.2-1.el7
0:14.17.2-1.el7
redhat/rh-nodejs14-nodejs-nodemon<0:2.0.3-2.el7
0:2.0.3-2.el7
redhat/hosted-git-info<3.0.8
3.0.8
redhat/hosted-git-info<2.8.9
2.8.9
IBM Cloud Pak for Security (CP4S)<=1.7.2.0
IBM Cloud Pak for Security (CP4S)<=1.7.1.0
IBM Cloud Pak for Security (CP4S)<=1.7.0.0
npmjs Hosted-git-info>=2.0.0<2.8.9
npmjs Hosted-git-info>=3.0.0<3.0.8
Siemens Sinec Infrastructure Network Services<1.0.1.1
Node.js Node.js>=12.0.0<12.22.2
12.22.2

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade redhat/rh-nodejs12-nodejs to a version that resolves this vulnerability.

    Fixed in 0:12.22.2-1.el7
  2. Upgrade

    Upgrade redhat/rh-nodejs12-nodejs-nodemon to a version that resolves this vulnerability.

    Fixed in 0:2.0.3-2.el7
  3. Upgrade

    Upgrade redhat/rh-nodejs14-nodejs to a version that resolves this vulnerability.

    Fixed in 0:14.17.2-1.el7
  4. Upgrade

    Upgrade redhat/rh-nodejs14-nodejs-nodemon to a version that resolves this vulnerability.

    Fixed in 0:2.0.3-2.el7
  5. Upgrade

    Upgrade redhat/hosted-git-info to a version that resolves this vulnerability.

    Fixed in 3.0.8
  6. Upgrade

    Upgrade redhat/hosted-git-info to a version that resolves this vulnerability.

    Fixed in 2.8.9
  7. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 12.22.2
  8. Upgrade

    Upgrade npm/hosted-git-info to a version that resolves this vulnerability.

    Fixed in 3.0.8
  9. Upgrade

    Upgrade npm/hosted-git-info to a version that resolves this vulnerability.

    Fixed in 2.8.9

Event History

Mar 23, 2021
CVE Published
12:00 AM
CVE Published
via MITRE·04:20 PM
Data Sourced
via MITRE·04:20 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·05:15 PM
RemedyDescriptionSeverityWeaknessAffected Software
Jul 1, 2021
Data Sourced
via Node.js·03:42 PM
SeverityAffected Software
Data Sourced
via Node.js·04:00 PM
Description

Frequently Asked Questions

1

What is the vulnerability ID for this vulnerability?

The vulnerability ID for this vulnerability is CVE-2021-23362.

2

What is the severity of CVE-2021-23362?

The severity of CVE-2021-23362 is high with a score of 7.5.

3

Which software versions are affected by CVE-2021-23362?

The affected software versions are hosted-git-info before 3.0.8 and 2.0.0 to 2.8.9.

4

How can an attacker exploit CVE-2021-23362?

An attacker can exploit CVE-2021-23362 by crafting a regular expression that takes an ever increasing amount of time to process, leading to a denial of service.

5

Where can I find more information about CVE-2021-23362?

You can find more information about CVE-2021-23362 at the following references: [link1](https://cert-portal.siemens.com/productcert/pdf/ssa-389290.pdf), [link2](https://github.com/npm/hosted-git-info/commit/29adfe5ef789784c861b2cdeb15051ec2ba651a7), [link3](https://github.com/npm/hosted-git-info/commit/8d4b3697d79bcd89cdb36d1db165e3696c783a01).

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203