Vulnerabilities in pkg:npm/websocket-extensions
PACKAGECVE-2020-7662 is a HIGH (CVSS 8.2) denial of service vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Websocket extensions libraries in the npm ecosystem. The issue involves regular expression denial of service in websocket-extensions (npm package). Remediation is available by upgrading affected packages to version 0.1.4.
pkg:npm/websocket-extensions
Vulnerability advisories affecting package pkg:npm/websocket-extensions. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-g78m-2chm-r7qv | CVE-2020-7662 | HIGH | Regular Expression Denial of Service in websocket-extensions (NPM package) |
CVE-2020-7662 at a Glance
Security Impact
CVSS: 8.2
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:L/A:H).
How to Fix CVE-2020-7662
To remediate this vulnerability, upgrade all affected Websocket extensions 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 websocket-extensions@0.1.4
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls websocket-extensions
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2020-7662, inspect your project dependencies using npm:
npm ls websocket-extensions
Analyze the terminal output to locate any version of Websocket extensions in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.1.4), your application is affected.
Note: The npm ls websocket-extensions 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-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. In Websocket extensions, 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-2020-7662 Affected Websocket extensions Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
websocket-extensions
|
npm |
< 0.1.4
|
0.1.4
|
References
Frequently Asked Questions
What is CVE-2020-7662?
Which Websocket extensions versions are affected?
What version fixes CVE-2020-7662?
Is websocket-extensions affected?
What is the CVSS score of CVE-2020-7662?
What CWE is associated with CVE-2020-7662?
How can I check npm dependencies for CVE-2020-7662?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-g78m-2chm-r7qv",
"modified" : "2021-08-25T21:51:05Z",
"published" : "2020-06-05T16:16:12Z",
"aliases" : [ "CVE-2020-7662" ],
"summary" : "Regular Expression Denial of Service in websocket-extensions (NPM package)",
"details" : "### Impact\n\nThe ReDoS flaw allows an attacker to exhaust the server's capacity to process\nincoming requests by sending a WebSocket handshake request containing a header\nof the following form:\n\n Sec-WebSocket-Extensions: a; b=\"\\c\\c\\c\\c\\c\\c\\c\\c\\c\\c ...\n\nThat is, a header containing an unclosed string parameter value whose content is\na repeating two-byte sequence of a backslash and some other character. The\nparser takes exponential time to reject this header as invalid, and this will\nblock the processing of any other work on the same thread. Thus if you are\nrunning a single-threaded server, such a request can render your service\ncompletely unavailable.\n\n### Patches\n\nUsers should upgrade to version 0.1.4.\n\n### Workarounds\n\nThere are no known work-arounds other than disabling any public-facing\nWebSocket functionality you are operating.\n\n### References\n\n- https://blog.jcoglan.com/2020/06/02/redos-vulnerability-in-websocket-extensions/",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "websocket-extensions"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.1.4"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/faye/websocket-extensions-node/security/advisories/GHSA-g78m-2chm-r7qv"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-7662"
}, {
"type" : "WEB",
"url" : "https://github.com/faye/websocket-extensions-node/commit/29496f6838bfadfe5a2f85dff33ed0ba33873237"
}, {
"type" : "WEB",
"url" : "https://blog.jcoglan.com/2020/06/02/redos-vulnerability-in-websocket-extensions"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/faye/websocket-extensions-node"
}, {
"type" : "WEB",
"url" : "https://snyk.io/vuln/SNYK-JS-WEBSOCKETEXTENSIONS-570623"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-400" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2020-06-03T23:10:26Z",
"nvd_published_at" : null
}
}