GHSA-m5h6-hr3q-22h5

Suggest an improvement
Source
https://github.com/advisories/GHSA-m5h6-hr3q-22h5
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2018/07/GHSA-m5h6-hr3q-22h5/GHSA-m5h6-hr3q-22h5.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-m5h6-hr3q-22h5
Aliases
Related
Published
2018-07-31T22:58:35Z
Modified
2023-11-08T03:58:27.818365Z
Summary
npm Token Leak in npm
Details

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
Database specific
{
    "nvd_published_at": "2016-07-02T14:59:00Z",
    "cwe_ids": [
        "CWE-200"
    ],
    "severity": "HIGH",
    "github_reviewed": true,
    "github_reviewed_at": "2020-06-16T21:45:00Z"
}
References

Affected packages

npm / npm

Package

Affected ranges

Type
SEMVER
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
2.15.1

Database specific

{
    "last_known_affected_version_range": "<= 2.15.0"
}

npm / npm

Package

Affected ranges

Type
SEMVER
Events
Introduced
3.0.0
Fixed
3.8.3

Database specific

{
    "last_known_affected_version_range": "<= 3.8.2"
}