Vulnerabilities in pkg:npm/urlregex

PACKAGE
Advisory Identifier: GHSA-rw72-v6c7-hf9r
Advisory Summary

CVE-2020-36830 is a MODERATE (CVSS 4.3) denial of service vulnerability (CWE-1333: Inefficient Regular Expression Complexity) affecting Urlregex libraries in the npm ecosystem. The issue involves redos in urlregex. Remediation is available by upgrading affected packages to version 0.5.1.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/urlregex

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/urlregex. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-rw72-v6c7-hf9r CVE-2020-36830 MODERATE ReDoS in urlregex

CVE-2020-36830 at a Glance

CVE Identifier CVE-2020-36830
GHSA Identifier GHSA-rw72-v6c7-hf9r
Severity MODERATE
CVSS v3.1 Base Score 4.3
CWE Classification CWE-1333: Inefficient Regular Expression Complexity
Affected Product Urlregex
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 4.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:L).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability Low (A:L)

How to Fix CVE-2020-36830

To remediate this vulnerability, upgrade all affected Urlregex dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

urlregex fixed: 0.5.1
npm install urlregex@0.5.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls urlregex

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2020-36830, inspect your project dependencies using npm:

npm ls urlregex

Analyze the terminal output to locate any version of Urlregex in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.5.1), your application is affected.

Note: The npm ls urlregex command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-1333: Inefficient Regular Expression Complexity, where the product uses a regular expression with a worst-case computational complexity that is inefficient and possibly exponential. In Urlregex, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

A vulnerability was found in nescalante urlregex up to 0.5.0 and classified as problematic. This issue affects some unknown processing of the file index.js of the component Backtracking. The manipulation leads to inefficient regular expression complexity. The attack may be initiated remotely. The exploit has been disclosed to the public and may be used. Upgrading to version 0.5.1 is able to address this issue. The identifier of the patch is e5a085afe6abfaea1d1a78f54c45af9ef43ca1f9. It is recommended to upgrade the affected component.

CVE-2020-36830 Affected Urlregex Versions

1 component(s)
Fixed Versions:
0.5.1
Product / Package Ecosystem Affected Versions Fixed Version
urlregex
npm
< 0.5.1
0.5.1

References

Frequently Asked Questions

What is CVE-2020-36830?
CVE-2020-36830 is a security vulnerability in Urlregex involving ReDoS in urlregex under CWE-1333: Inefficient Regular Expression Complexity.
Which Urlregex versions are affected?
Affected versions include releases prior to 0.5.1 across affected packages: urlregex.
What version fixes CVE-2020-36830?
Upgrading to 0.5.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is urlregex affected?
Yes, urlregex is affected in releases prior to 0.5.1. Upgrade your dependency to 0.5.1 or later.
What is the CVSS score of CVE-2020-36830?
CVE-2020-36830 has a CVSS v3.1 base score of 4.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:L.
What CWE is associated with CVE-2020-36830?
CVE-2020-36830 is classified under CWE-1333: Inefficient Regular Expression Complexity (The product uses a regular expression with a worst-case computational complexity that is inefficient and possibly exponential.).
How can I check npm dependencies for CVE-2020-36830?
Run the dependency tree command: 'npm ls urlregex'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-rw72-v6c7-hf9r",
  "modified" : "2024-09-03T21:03:07Z",
  "published" : "2024-09-02T18:31:24Z",
  "aliases" : [ "CVE-2020-36830" ],
  "summary" : "ReDoS in urlregex",
  "details" : "A vulnerability was found in nescalante urlregex up to 0.5.0 and classified as problematic. This issue affects some unknown processing of the file index.js of the component Backtracking. The manipulation leads to inefficient regular expression complexity. The attack may be initiated remotely. The exploit has been disclosed to the public and may be used. Upgrading to version 0.5.1 is able to address this issue. The identifier of the patch is e5a085afe6abfaea1d1a78f54c45af9ef43ca1f9. It is recommended to upgrade the affected component.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:L"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "urlregex"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.5.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-36830"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nescalante/urlregex/pull/8"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nescalante/urlregex/commit/e5a085afe6abfaea1d1a78f54c45af9ef43ca1f9"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/nescalante/urlregex"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nescalante/urlregex/releases/tag/v0.5.1"
  }, {
    "type" : "WEB",
    "url" : "https://vuldb.com/?ctiid.276269"
  }, {
    "type" : "WEB",
    "url" : "https://vuldb.com/?id.276269"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1333" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-09-03T21:03:07Z",
    "nvd_published_at" : "2024-09-02T18:15:20Z"
  }
}