CVE-2020-7663: Websocket extensions Denial of Service Vulnerability

HIGH
Advisory Identifier: GHSA-g6wq-qcwm-j5g2
CVSS 8.2
CWE-400
Published
Advisory Summary

CVE-2020-7663 is a HIGH (CVSS 8.2) denial of service vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Websocket extensions libraries in the RubyGems ecosystem. The issue involves regular expression denial of service in websocket-extensions (rubygem). Remediation is available by upgrading affected packages to version 0.1.5.

CVE-2020-7663 at a Glance

CVE Identifier CVE-2020-7663
GHSA Identifier GHSA-g6wq-qcwm-j5g2
Severity HIGH
CVSS v3.1 Base Score 8.2
CWE Classification CWE-400: Uncontrolled Resource Consumption
Affected Product Websocket extensions
Package Ecosystem RubyGems
Published Date
Last Updated

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).

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 Low (I:L)
Availability High (A:H)

How to Fix CVE-2020-7663

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.

websocket-extensions fixed: 0.1.5
Upgrade websocket-extensions to 0.1.5
Verify Direct and Transitive Dependencies

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

inspect dependencies for websocket-extensions

How to Check if You Are Affected

To determine whether your application is affected by CVE-2020-7663, inspect your project dependencies for Websocket extensions:

inspect dependencies for 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.5), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

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

### Impact The ReDoS flaw allows an attacker to exhaust the server's capacity to process incoming requests by sending a WebSocket handshake request containing a header of the following form: Sec-WebSocket-Extensions: a; b="\c\c\c\c\c\c\c\c\c\c ... That is, a header containing an unclosed string parameter value whose content is a repeating two-byte sequence of a backslash and some other character. The parser takes exponential time to reject this header as invalid, and this will block the processing of any other work on the same thread. Thus if you are running a single-threaded server, such a request can render your service completely unavailable. ### Patches Users should upgrade to version 0.1.5. ### Workarounds There are no known work-arounds other than disabling any public-facing WebSocket functionality you are operating. ### References - https://blog.jcoglan.com/2020/06/02/redos-vulnerability-in-websocket-extensions/

CVE-2020-7663 Affected Websocket extensions Versions

1 component(s)
Fixed Versions:
0.1.5
Product / Package Ecosystem Affected Versions Fixed Version
websocket-extensions
RubyGems
< 0.1.5
0.1.5

References

Frequently Asked Questions

What is CVE-2020-7663?
CVE-2020-7663 is a security vulnerability in Websocket extensions involving Regular Expression Denial of Service in websocket-extensions (RubyGem) under CWE-400: Uncontrolled Resource Consumption.
Which Websocket extensions versions are affected?
Affected versions include releases prior to 0.1.5 across affected packages: websocket-extensions.
What version fixes CVE-2020-7663?
Upgrading to 0.1.5 (or the latest patched release for your respective branch) resolves the vulnerability.
Is websocket-extensions affected?
Yes, websocket-extensions is affected in releases prior to 0.1.5. Upgrade your dependency to 0.1.5 or later.
What is the CVSS score of CVE-2020-7663?
CVE-2020-7663 has a CVSS v3.1 base score of 8.2 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:H.
What CWE is associated with CVE-2020-7663?
CVE-2020-7663 is classified under CWE-400: Uncontrolled Resource Consumption (The product does not properly control the allocation and maintenance of a limited resource.).
How can I check RubyGems dependencies for CVE-2020-7663?
Run the dependency tree command: 'inspect dependencies for websocket-extensions'. 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-g6wq-qcwm-j5g2",
  "modified" : "2023-05-16T16:17:54Z",
  "published" : "2020-06-05T14:21:29Z",
  "aliases" : [ "CVE-2020-7663" ],
  "summary" : "Regular Expression Denial of Service in websocket-extensions (RubyGem)",
  "details" : "### Impact\n\nThe ReDoS flaw allows an attacker to exhaust the server's capacity to process incoming requests by sending a WebSocket handshake request containing a header of 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 a repeating two-byte sequence of a backslash and some other character. The parser takes exponential time to reject this header as invalid, and this will block the processing of any other work on the same thread. Thus if you are running a single-threaded server, such a request can render your service completely unavailable.\n\n### Patches\n\nUsers should upgrade to version 0.1.5.\n\n### Workarounds\n\nThere are no known work-arounds other than disabling any public-facing WebSocket 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" : "RubyGems",
      "name" : "websocket-extensions"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.1.5"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/faye/websocket-extensions-ruby/security/advisories/GHSA-g6wq-qcwm-j5g2"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-7663"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/faye/websocket-extensions-ruby/commit/aa156a439da681361ed6f53f1a8131892418838b"
  }, {
    "type" : "WEB",
    "url" : "https://blog.jcoglan.com/2020/06/02/redos-vulnerability-in-websocket-extensions"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/faye/websocket-extensions-ruby"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/websocket-extensions/CVE-2020-7663.yml"
  }, {
    "type" : "WEB",
    "url" : "https://lists.debian.org/debian-lts-announce/2020/08/msg00031.html"
  }, {
    "type" : "WEB",
    "url" : "https://snyk.io/vuln/SNYK-RUBY-WEBSOCKETEXTENSIONS-570830"
  }, {
    "type" : "WEB",
    "url" : "https://usn.ubuntu.com/4502-1"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-400" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-06-03T23:10:34Z",
    "nvd_published_at" : "2020-06-02T19:15:00Z"
  }
}