CVE-2016-10518: Ws Remote Memory Disclosure Vulnerability
LOWCVE-2016-10518 is a LOW remote memory disclosure vulnerability (CWE-201: Insertion of Sensitive Information Into Sent Data) affecting Ws libraries in the npm ecosystem. The issue involves remote memory disclosure in ws. Remediation is available by upgrading affected packages to version 1.0.1.
CVE-2016-10518 at a Glance
How to Fix CVE-2016-10518
To remediate this vulnerability, upgrade all affected Ws dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install ws@1.0.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls ws
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2016-10518, inspect your project dependencies using npm:
npm ls ws
Analyze the terminal output to locate any version of Ws in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.0.1), your application is affected.
Note: The npm ls ws command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-201: Insertion of Sensitive Information Into Sent Data, where the code transmits data to another actor, but a portion of the data includes sensitive information that should not be accessible to that actor. In Ws, 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
CVE-2016-10518 Affected Ws Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
ws
|
npm |
< 1.0.1
|
1.0.1
|
References
Frequently Asked Questions
What is CVE-2016-10518?
Which Ws versions are affected?
What version fixes CVE-2016-10518?
Is ws affected?
What CWE is associated with CVE-2016-10518?
How can I check npm dependencies for CVE-2016-10518?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-2mhh-w6q8-5hxw",
"modified" : "2020-08-31T18:09:55Z",
"published" : "2019-02-18T23:56:42Z",
"aliases" : [ "CVE-2016-10518" ],
"summary" : "Remote Memory Disclosure in ws",
"details" : "Versions of `ws` prior to 1.0.1 are affected by a remote memory disclosure vulnerability.\n\nIn 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.\n\n\n\n## Proof of Concept\n```\nvar ws = require('ws')\n\nvar server = new ws.Server({ port: 9000 })\nvar client = new ws('ws://localhost:9000')\n\nclient.on('open', function () {\n console.log('open')\n client.ping(50) // this sends a non-zeroed buffer of 50 bytes\n\n client.on('pong', function (data) {\n console.log('got pong')\n console.log(data) // Data from the client. \n })\n})\n```\n\n\n## Recommendation\n\nUpdate to version 1.0.1 or greater.",
"severity" : [ ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "ws"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.0.1"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2016-10518"
}, {
"type" : "WEB",
"url" : "https://github.com/websockets/ws/commit/29293ed11b679e0366fa0f6bb9310b330dafd795"
}, {
"type" : "WEB",
"url" : "https://gist.github.com/c0nrad/e92005446c480707a74a"
}, {
"type" : "ADVISORY",
"url" : "https://github.com/advisories/GHSA-2mhh-w6q8-5hxw"
}, {
"type" : "WEB",
"url" : "https://github.com/websockets/ws/releases/tag/1.0.1"
}, {
"type" : "WEB",
"url" : "https://www.npmjs.com/advisories/67"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-201" ],
"severity" : "LOW",
"github_reviewed" : true,
"github_reviewed_at" : "2020-06-16T20:52:34Z",
"nvd_published_at" : null
}
}