Severity: high

npm Token Leak



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.


  1. Update npm with npm install [email protected] -g
  2. Revoke your Tokens
  3. Enable Two-Factor Authentication
Have content suggestions? Send them to [email protected]

Advisory timeline

  1. published

    Advisory published
    Apr 18th, 2016
  2. reported

    Initial report by Mitar, Will White & the team at Mapbox, Max Motovilov, and James Taylor
    Apr 1st, 2016