CVE-2017-20165: Debug Debug Inefficient Regular Expression Complexity Vulnerability
HIGHCVE-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
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).
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.
npm install debug@3.1.0
npm install debug@2.6.9
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
CVE-2017-20165 Affected Debug Versions
2 component(s)References
Frequently Asked Questions
What is CVE-2017-20165?
Which Debug versions are affected?
What version fixes CVE-2017-20165?
Is debug affected?
What is the CVSS score of CVE-2017-20165?
What CWE is associated with CVE-2017-20165?
How can I check npm dependencies for CVE-2017-20165?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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"
}
}