CVE-2016-3956:
npm Token Leak in npm
7.5
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.84318%
CWE
Published
7/31/2018
Updated
2/1/2023
KEV Status
No
Technology
JavaScript
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
npm | npm | <= 2.15.0 | 2.15.1 |
npm | npm | >= 3.0.0, <= 3.8.2 | 3.8.3 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stemmed from npm CLI sending bearer tokens to all HTTP endpoints. The key functions identified are:
- mapToRegistry: Directly responsible for resolving registry URLs and attaching credentials. Pre-patch versions lacked host validation (fixed via scopeAuth helper in commits f67ecad/fea8cc9).
- getCredentialsByURI: Provided credentials without context-aware filtering. The 'alwaysAuth' logic was applied too broadly before registry host validation checks were added. The commit diffs show critical changes to these functions, including the introduction of host-matching logic and credential scoping.