CVE-2017-20165: Debug Debug Inefficient Regular Expression Complexity Vulnerability

HIGH
Advisory Identifier: GHSA-9vvw-cc9w-f27h
CVSS 7.5
CWE-1333
Published
Advisory Summary

CVE-2017-20165 is a HIGH (CVSS 7.5) debug inefficient regular expression complexity vulnerability (CWE-1333: Inefficient Regular Expression Complexity) affecting Debug libraries in the npm ecosystem. The issue involves debug inefficient regular expression complexity vulnerability. Remediation is available by upgrading affected packages to version 3.1.0, 2.6.9.

CVE-2017-20165 at a Glance

CVE Identifier CVE-2017-20165
GHSA Identifier GHSA-9vvw-cc9w-f27h
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-1333: Inefficient Regular Expression Complexity
Affected Product Debug
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 7.5

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

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

How to Fix CVE-2017-20165

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

debug fixed: 3.1.0
npm install debug@3.1.0
debug fixed: 2.6.9
npm install debug@2.6.9
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 debug

How to Check if You Are Affected

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

npm ls debug

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

Note: The npm ls debug 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 Debug, 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 classified as problematic has been found in debug-js debug up to 3.0.x. This affects the function useColors of the file src/node.js. The manipulation of the argument str leads to inefficient regular expression complexity. Upgrading to version 3.1.0 is able to address this issue. The name of the patch is c38a0166c266a679c8de012d4eaccec3f944e685. It is recommended to upgrade the affected component. The identifier VDB-217665 was assigned to this vulnerability. The patch has been backported to the 2.6.x branch in version 2.6.9.

CVE-2017-20165 Affected Debug Versions

2 component(s)
Fixed Versions:
3.1.02.6.9
Product / Package Ecosystem Affected Versions Fixed Version
debug
npm
≥ 3.0.0
< 3.1.0
3.1.0
debug
npm
< 2.6.9
2.6.9

References

Frequently Asked Questions

What is CVE-2017-20165?
CVE-2017-20165 is a security vulnerability in Debug involving debug Inefficient Regular Expression Complexity vulnerability under CWE-1333: Inefficient Regular Expression Complexity.
Which Debug versions are affected?
Affected versions include releases prior to 3.1.0, 2.6.9 across affected packages: debug.
What version fixes CVE-2017-20165?
Upgrading to 3.1.0, 2.6.9 (or the latest patched release for your respective branch) resolves the vulnerability.
Is debug affected?
Yes, debug is affected in releases prior to 3.1.0, 2.6.9. Upgrade your dependency to 3.1.0, 2.6.9 or later.
What is the CVSS score of CVE-2017-20165?
CVE-2017-20165 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2017-20165?
CVE-2017-20165 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-2017-20165?
Run the dependency tree command: 'npm ls debug'. 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-9vvw-cc9w-f27h",
  "modified" : "2023-01-13T17:19:08Z",
  "published" : "2023-01-09T12:30:19Z",
  "aliases" : [ "CVE-2017-20165" ],
  "summary" : "debug Inefficient Regular Expression Complexity vulnerability",
  "details" : "A vulnerability classified as problematic has been found in debug-js debug up to 3.0.x. This affects the function useColors of the file src/node.js. The manipulation of the argument str leads to inefficient regular expression complexity. Upgrading to version 3.1.0 is able to address this issue. The name of the patch is c38a0166c266a679c8de012d4eaccec3f944e685. It is recommended to upgrade the affected component. The identifier VDB-217665 was assigned to this vulnerability. The patch has been backported to the 2.6.x branch in version 2.6.9.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "debug"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.0.0"
      }, {
        "fixed" : "3.1.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "debug"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.6.9"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2017-20165"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/debug-js/debug/pull/504"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/debug-js/debug/commit/c38a0166c266a679c8de012d4eaccec3f944e685"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/debug-js/debug/commit/f53962e944a87e6ca9bb622a2a12dffc22a9bb5a"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/debug-js/debug"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/debug-js/debug/releases/tag/2.6.9"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/debug-js/debug/releases/tag/3.1.0"
  }, {
    "type" : "WEB",
    "url" : "https://vuldb.com/?ctiid.217665"
  }, {
    "type" : "WEB",
    "url" : "https://vuldb.com/?id.217665"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1333" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-01-10T21:49:01Z",
    "nvd_published_at" : "2023-01-09T10:15:00Z"
  }
}