# CVE-2016-3956: npm Token Leak in npm

> The npm CLI sends bearer tokens to arbitrary remote servers, allowing attackers to steal sensitive authentication information.

- **Severity:** High 7.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 2 Jul 2016
- **Updated:** 6 Aug 2024
- **Also known as:** CVE-2016-1000014, DEBIAN-CVE-2016-3956, GHSA-m5h6-hr3q-22h5, MINI-rqw2-fqcx-hhfg, UBUNTU-CVE-2016-3956, USN-4785-1

## What is CVE-2016-3956?

CVE-2016-3956 is a high-severity vulnerability in Nodejs Node.js, published on 2 Jul 2016. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

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.

Weakness: CWE-200 (Exposure of Sensitive Information to an Unauthorized Actor)

## Which versions are affected by CVE-2016-3956?

4 open source packages ship an affected version, including npm. It affects 3 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `npm` | npm | All versions | 2.15.1 |
| `npm` | npm | All versions | 2.15.1 |
| `npm` | npm | From 3.0.0 | 3.8.3 |
| `npm` | npm | From 3.0.0 | 3.8.3 |

Products: Ibm Sdk, Nodejs Node.js, Npmjs Npm.

## How do I fix CVE-2016-3956?

Upgrade npm to a fixed version for your release line: 2.15.1 or 3.8.3.

## Is CVE-2016-3956 being exploited?

There is no known exploitation of CVE-2016-3956 in the wild and no public exploit code.

## Other vulnerabilities in Nodejs Node.js

- [CVE-2017-1289](https://insights.sbomify.com/CVE-2017-1289/): XML external entity in Runtimes for Java Technology (high 8.2)
- [CVE-2022-40609](https://insights.sbomify.com/CVE-2022-40609/): IBM SDK, Java Technology Edition code execution (high 8.1)
- [CVE-2018-1656](https://insights.sbomify.com/CVE-2018-1656/): Path traversal in SDK, Java Technology Edition (high 7.4)
- [CVE-2019-4732](https://insights.sbomify.com/CVE-2019-4732/): Other in Java (high 7.2)
- [CVE-2018-1890](https://insights.sbomify.com/CVE-2018-1890/): Code injection in Runtimes for Java Technology (medium 5.6)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2016-3956 and fix it if it is affected.

What it is: CVE-2016-3956 is a high-severity vulnerability in Nodejs Node.js, published on 2 Jul 2016. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2016-3956 in the wild and no public exploit code.

Affected packages and fixed versions:
- npm (npm): affected all versions; fixed in 2.15.1
- npm (npm): affected all versions; fixed in 2.15.1
- npm (npm): affected from 3.0.0; fixed in 3.8.3
- npm (npm): affected from 3.0.0; fixed in 3.8.3

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2016-3956/ (Markdown: https://insights.sbomify.com/CVE-2016-3956/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2016-3956
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2016-3956
- OSV: https://osv.dev/vulnerability/CVE-2016-3956

---
From sbomify Insights: https://insights.sbomify.com/CVE-2016-3956/
Summaries are generated and may contain mistakes; the official description above is the record.
