Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. ws
  4. ›
  5. CVE-2016-10518

CVE-2016-10518: Improper Restriction of Operations within the Bounds of a Memory Buffer

February 18, 2019 (updated January 8, 2021)

A vulnerability was found in the ping functionality of the ws module before 1.0.0 which allowed clients to allocate memory by sending a ping frame. The ping functionality by default responds with a pong frame and the previously given payload of the ping frame. This is exactly what you expect, but internally ws always transforms all data that we need to send to a Buffer instance and that is where the vulnerability existed. ws didn’t do any checks for the type of data it was sending. With buffers in node when you allocate it when a number instead of a string it will allocate the amount of bytes.

References

  • gist.github.com/c0nrad/e92005446c480707a74a
  • github.com/advisories/GHSA-2mhh-w6q8-5hxw
  • github.com/websockets/ws/releases/tag/1.0.1
  • nodesecurity.io/advisories/67
  • nvd.nist.gov/vuln/detail/CVE-2016-10518
  • www.npmjs.com/advisories/67

Code Behaviors & Features

Detect and mitigate CVE-2016-10518 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 1.0.1

Fixed versions

  • 1.0.1

Solution

Upgrade to version 1.0.1 or above.

Impact 7.5 HIGH

CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N

Learn more about CVSS

Weakness

  • CWE-119: Improper Restriction of Operations within the Bounds of a Memory Buffer

Source file

npm/ws/CVE-2016-10518.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:16:12 +0000.