Skip to content

npm Token Leak in npm

High severity GitHub Reviewed Published Jul 31, 2018 to the GitHub Advisory Database • Updated Feb 1, 2023

Package

npm npm (npm)

Affected versions

<= 2.15.0
>= 3.0.0, <= 3.8.2

Patched versions

2.15.1
3.8.3

Description

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

References

Published by the National Vulnerability Database Jul 2, 2016
Published to the GitHub Advisory Database Jul 31, 2018
Reviewed Jun 16, 2020
Last updated Feb 1, 2023

Severity

High

EPSS score

0.236%
(62nd percentile)

Weaknesses

CVE ID

CVE-2016-3956

GHSA ID

GHSA-m5h6-hr3q-22h5

Source code

No known source code
Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.