CVE-2016-10518
Remote Memory Disclosure in ws
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.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- High
- Integrity
- None
- Availability
- None
Exploit likelihood
What each source reports
NVD Score used
7.5
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.
- Record
CVE-2016-10518- CVSS 3.0
- 7.5 High
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N - CVSS 2.0
- 5.0 Medium
AV:N/AC:L/Au:N/C:P/I:N/A:N - Weakness
- CWE-201, CWE-119
- Updated
- 2026-11-02
CVE List No score
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.
- Record
CVE-2016-10518- Weakness
- CWE-201
- Updated
- 2026-11-02
EUVDEUVD-2019-0201 No score
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.
- Record
EUVD-2019-0201- Updated
- 2026-11-03
GitHub AdvisoriesGHSA-5v72-xg48-5rpm
7.5
Denial of Service in ws
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.
- Record
GHSA-5v72-xg48-5rpm- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Weakness
- CWE-400
- Updated
- 2026-11-02
GitHub AdvisoriesGHSA-2mhh-w6q8-5hxw No score
Remote Memory Disclosure in ws
Versions of ws prior to 1.0.1 are affected by a remote memory disclosure vulnerability.
In certain rare circumstances, applications which allow users to control the arguments of a client.ping() call will cause ws to send the contents of an allocated but non-zero-filled buffer to the server. This may disclose sensitive information that still exists in memory after previous use of the memory for other tasks.
Proof of Concept
var ws = require('ws')
var server = new ws.Server({ port: 9000 })
var client = new ws('ws://localhost:9000')
client.on('open', function () {
console.log('open')
client.ping(50) // this sends a non-zeroed buffer of 50 bytes
client.on('pong', function (data) {
console.log('got pong')
console.log(data) // Data from the client.
})
})
Recommendation
Update to version 1.0.1 or greater.
- Record
GHSA-2mhh-w6q8-5hxw- Weakness
- CWE-201
- Updated
- 2026-11-02
OSV
7.5
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.
- Record
CVE-2016-10518- CVSS 3.0
- 7.5 High
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N - Updated
- 2026-11-02
Show 7 moreShow less
OSVDEBIAN-CVE-2016-10518
7.5
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.
- Record
DEBIAN-CVE-2016-10518- CVSS 3.0
- 7.5 High
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N - Updated
- 2026-11-02
OSVGHSA-5v72-xg48-5rpm
7.5
Denial of Service in ws
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.
- Record
GHSA-5v72-xg48-5rpm- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Weakness
- CWE-400
- Updated
- 2026-11-02
OSVUBUNTU-CVE-2016-10518
7.5
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.
- Record
UBUNTU-CVE-2016-10518- CVSS 3.0
- 7.5 High
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N - Updated
- 2026-11-02
OSVCLSA-2026-1772583196 No score
TuxCare security update for ws (1 CVE)
TuxCare rebuilt ws to address 1 CVE. Fixed in 1.1.1-tuxcare.1.
- Record
CLSA-2026-1772583196- Updated
- 2026-11-02
OSVCLSA-2026-1776991058 No score
TuxCare security update for ws (1 CVE)
TuxCare rebuilt ws to address 1 CVE. Fixed in 1.1.2-tuxcare.1.
- Record
CLSA-2026-1776991058- Updated
- 2026-11-02
OSVCLSA-2026-1784596272 No score
TuxCare security update for ws (2 CVEs)
TuxCare rebuilt ws to address 2 CVEs. Fixed in 0.8.1-tuxcare.1.
- Record
CLSA-2026-1784596272- Updated
- 2026-11-02
OSVGHSA-2mhh-w6q8-5hxw No score
Remote Memory Disclosure in ws
Versions of ws prior to 1.0.1 are affected by a remote memory disclosure vulnerability.
In certain rare circumstances, applications which allow users to control the arguments of a client.ping() call will cause ws to send the contents of an allocated but non-zero-filled buffer to the server. This may disclose sensitive information that still exists in memory after previous use of the memory for other tasks.
Proof of Concept
var ws = require('ws')
var server = new ws.Server({ port: 9000 })
var client = new ws('ws://localhost:9000')
client.on('open', function () {
console.log('open')
client.ping(50) // this sends a non-zeroed buffer of 50 bytes
client.on('pong', function (data) {
console.log('got pong')
console.log(data) // Data from the client.
})
})
Recommendation
Update to version 1.0.1 or greater.
- Record
GHSA-2mhh-w6q8-5hxw- Weakness
- CWE-201
- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
wsnpm |
before 1.0.1 | 1.0.1 |
wsnpm |
2.0.0 up to 3.3.1 | 3.3.1 |
wsnpm |
0.6.0 up to 1.1.5 | 1.1.5 |
wsTuxCare:npm |
1.1.1-tuxcare.0 up to 1.1.1-tuxcare.1, plus listed versions 1.1.1 |
1.1.1-tuxcare.1 |
wsTuxCare:npm |
1.1.2-tuxcare.0 up to 1.1.2-tuxcare.1, plus listed versions 1.1.2 |
1.1.2-tuxcare.1 |
wsTuxCare:npm |
0.8.1-tuxcare.0 up to 0.8.1-tuxcare.1, plus listed versions 0.8.1 |
0.8.1-tuxcare.1 |
node-wsDebian:12 |
before 1.0.1+ds1.e6ddaae4-1 | 1.0.1+ds1.e6ddaae4-1 |
node-wsDebian:13 |
before 1.0.1+ds1.e6ddaae4-1 | 1.0.1+ds1.e6ddaae4-1 |
node-wsDebian:14 |
before 1.0.1+ds1.e6ddaae4-1 | 1.0.1+ds1.e6ddaae4-1 |
node-wsUbuntu:16.04:LTS |
before 1.0.1+ds1.e6ddaae4-1, plus listed versions 0.7.2+ds1.349b7460-1 |
1.0.1+ds1.e6ddaae4-1 |
History
| Recorded | Changed | Sources |
|---|---|---|
| aliases | EUVD | |
| first indexed | CVE List, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2016-10518 is a high vulnerability (CVSS 7.5) in Ws Project Ws, published May 31, 2018. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 1.98%, the 80th percentile. Fixed in ws 1.0.1.
References
github.com/websockets/ws/releases/tag/1.0.1
nodesecurity.io/advisories/67
gist.github.com/c0nrad/e92005446c480707a74a
nvd.nist.gov/vuln/detail/CVE-2016-10518
github.com/advisories/GHSA-2mhh-w6q8-5hxw
npmjs.com/advisories/67
Show 10 moreShow less
github.com/websockets/ws/commit/29293ed11b679e0366fa0f6bb9310b330dafd795
github.com/websockets/ws/commit/c4fe46608acd61fbf7397eadc47378903f95b78a
snyk.io/vuln/npm:ws:20171108
github.com/websockets/ws/commit/f8fdcd40ac8be7318a6ee41f5ceb7e77c995b407
github.com/websockets/ws/commit/a810bfa44f08c84ff3f43cc71327e9bb5fb273ef
github.com/advisories/GHSA-5v72-xg48-5rpm
security-tracker.debian.org/tracker/CVE-2016-10518
github.com/websockets/ws
ubuntu.com/security/CVE-2016-10518
cve.org/CVERecord?id=CVE-2016-10518