Sensitive Information Exposure in npm CLI - CVE-2016-3956
Summary
CVE-2016-3956: The CLI in npm before 2.15.1 and 3.x before 3.8.3, as used in Node.js 0.10 before 0.10.44, 0.12 before 0.12.13, 4 before 4.4.2, and 5 before 5.10.0, includes bearer tokens with arbitrary requests, which allows remote HTT... Affects npm across 4 version ranges.
< 5.8.0+ds-2
< e93d20877150a78c5147031866a550d256f46529
< f67ecad59e99a03e5aad8e93cd1a086ae087cb29
< fea8cc92cee02c720b58f95f14d315507ccad401
Fixed in 5.8.0+ds-2. How to fix ↓
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.
No signup required · Results in about 60 seconds
Background
npm (Node Package Manager) is a widely used package manager for JavaScript, primarily for Node.js applications. It allows developers to install, share, and manage dependencies in their projects. The npm CLI is the command-line interface that facilitates these operations. This vulnerability affects multiple versions of npm, specifically versions prior to 2.15.1 and 3.x before 3.8.3, exposing sensitive information through Authorization headers in HTTP requests.
Vulnerability Detail
CVE-2016-3956 is a vulnerability in the npm CLI that allows remote HTTP servers to access sensitive information by reading Authorization headers. This occurs when bearer tokens are included in arbitrary requests made by the npm CLI. The vulnerability can lead to unauthorized access to sensitive data, potentially compromising user credentials and other confidential information. The issue arises from improper handling of bearer tokens in HTTP requests, making it critical for users to update their npm installations to mitigate the risk.
How To Fix
Minimum fixed version
5.8.0+ds-2
This is the first release that contains the fix.
sudo apt-get install --only-upgrade npm
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
As a temporary workaround, users can avoid including sensitive bearer tokens in requests made by the npm CLI until they can update to a secure version. This can be done by ensuring that any scripts or commands do not pass Authorization headers or tokens.
Conclusion
CVE-2016-3956 is a significant vulnerability in the npm CLI that can expose sensitive information through improper handling of Authorization headers. It is crucial for users to update their npm installations to mitigate this risk and protect their applications from unauthorized access.
See every vulnerability recorded for npm →
FAQ
CVE-2016-3956 is a vulnerability in the npm CLI that allows unauthorized access to sensitive information through exposed Authorization headers.
npm versions before 2.15.1 and 3.x before 3.8.3 are affected by this vulnerability.
You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without any signup.
As a temporary measure, avoid including sensitive bearer tokens in requests made by the npm CLI until you can update to a secure version.
The CVSS score for CVE-2016-3956 is 7.5, indicating a high severity level.
Related vulnerabilities
Recent vulnerabilities recorded for npm.