CVE-2016-3956: Infoleak
Affected versions of the npm package include the bearer token of the logged in user in every request made by the CLI, even if the request is not directed towards the user's active registry.
An attacker could create an HTTP server to collect tokens, and by various means including but not limited to install scripts, cause the npm CLI to make a request to that server, which would compromise the user's token.
This compromised token could be used to do anything that the user could do, including publishing new packages.
Recommendation
1. Update npm with npm install npm@latest -g 2. Revoke your Tokens 3. Enable Two-Factor Authentication
Other sources
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 HTTP servers to obtain sensitive information by reading Authorization headers.
— MITRE
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
npm/npmto a version that resolves this vulnerability.Fixed in 3.8.3 - Upgrade
Upgrade
npm/npmto a version that resolves this vulnerability.Fixed in 2.15.1 - Upgrade
Upgrade
debian/npmto a version that resolves this vulnerability.Fixed in 5.8.0+ds-2 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 2.15.1 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 3.8.3 - Configuration
Enable Two-Factor Authentication for the npm account.
npm account Two-Factor Authentication = enabled - Operational
Revoke npm tokens that may have been exposed.
Event History
Frequently Asked Questions
What is the severity of CVE-2016-3956?
The severity of CVE-2016-3956 is classified as moderate, as it allows remote servers to potentially access sensitive information through the Authorization header.
How do I fix CVE-2016-3956?
To fix CVE-2016-3956, update npm to versions 2.15.1 or later, or 3.8.3 or later.
Which versions of Node.js are affected by CVE-2016-3956?
CVE-2016-3956 affects Node.js versions 0.10 before 0.10.44, 0.12 before 0.12.13, 4 before 4.4.2, and 5 before 5.10.0.
Does CVE-2016-3956 affect npm?
Yes, CVE-2016-3956 affects npm versions prior to 2.15.1 and versions between 3.0.0 and 3.8.2.
What is the impact of CVE-2016-3956?
The impact of CVE-2016-3956 is that it allows unauthorized access to bearer tokens in HTTP requests, posing a risk of sensitive data exposure.