CVE-2016-10542: Denial of Service in ws

ws Updated 02 Oct 2025

Summary

18/02/2019
Yes i
High
Not published

CVE-2016-10542: DoS due to excessively large websocket message in ws. Affects ws versions < 1.1.1. Fixed in 1.1.1. How to fix ↓

Also tracked for

The same CVE-2016-10542 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

The 'ws' package is an npm package used for WebSocket implementation in Node.js. It provides a simple and efficient way to create WebSocket servers and clients. WebSocket is a communication protocol that provides full-duplex communication channels over a single TCP connection. The 'ws' package is widely used in various applications for real-time communication between the server and clients.

Vulnerability Detail

The vulnerability, identified as CVE-2016-10542, affects certain versions of the 'ws' package. It arises from the package's failure to properly limit the size of incoming WebSocket payloads. As a result, an attacker can send excessively large WebSocket messages, causing the node process to crash and resulting in a denial of service (DoS) condition. This vulnerability has a high severity rating and can lead to service disruption and unavailability.

How To Fix

Latest published version: 8.22.0 as of 22 Oct 2026

npm install ws@8.22.0

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

1.1.1

This is the first release that contains the fix.

npm install ws@1.1.1

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If updating the 'ws' package is not immediately possible, a temporary workaround can be implemented by setting the 'maxpayload' option for the 'ws' server to a smaller value. For example, the following code snippet demonstrates how to set the 'maxpayload' option to 10MB:

const WebSocket = require('ws');

const wss = new WebSocket.Server({
  maxPayload: 10 * 1024 * 1024 // 10MB
});

Conclusion

In conclusion, the 'ws' package is vulnerable to a denial of service (DoS) attack due to its failure to limit the size of incoming WebSocket payloads. To mitigate this vulnerability, it is crucial to update the package to version 1.1.1 or later. Alternatively, the 'maxpayload' option can be adjusted to limit the payload size. Prompt action is recommended to prevent service disruption and ensure the security of the application. For further support on vulnerability remediation, you can contact DevNack.com.

See every vulnerability recorded for ws →

Share this vulnerability

FAQ

The vulnerability allows an attacker to send excessively large WebSocket messages, causing the node process to crash and resulting in a denial of service (DoS) condition. This can lead to service disruption and unavailability.

The vulnerability affects versions of the 'ws' package prior to version 1.1.1.

If updating the 'ws' package is not feasible, you can set the 'maxpayload' option for the 'ws' server to a value smaller than 256MB. This will limit the size of incoming WebSocket payloads and reduce the risk of a DoS attack.

There are no known public exploits specifically targeting this vulnerability at the moment. However, it is important to promptly update the 'ws' package or apply the recommended workaround to mitigate the risk.

You can find more information about this vulnerability, including the advisory and fix details, in the GitHub Security Advisory database: https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2019/02/GHSA-6663-c963-2gqg/GHSA-6663-c963-2gqg.json

Related vulnerabilities

Recent vulnerabilities recorded for ws.

How To Fix

Latest published version: 8.22.0 as of 22 Oct 2026

npm install ws@8.22.0

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

1.1.1

This is the first release that contains the fix.

npm install ws@1.1.1

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback