GitHub Advisoryadvisory · npm

GHSA-m6cx-g6qm-p2cx Arbitrary File Write in npm

HIGH Published 2019-12-13 Modified 2021-10-21 Official page ↗
Aliases
CVE-2019-16775
Ecosystem
npm
Packages
npm
Severity
High
CVSS vector
CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:H/I:H/A:N
Weaknesses
CWE-59, CWE-61
Reviewed
2020-06-17

Affected packages

• npm npm: < 6.13.3 → fixed in 6.13.3

Description

Versions of the npm CLI prior to 6.13.3 are vulnerable to an Arbitrary File Write. It fails to prevent access to folders outside of the intended node_modules folder through the bin field. A properly constructed entry in the package.json bin field would allow a package publisher to create files on a user's system when the package is installed. It is only possible to affect files that the user running `npm install` has access to and it is not possible to over write files that already exist on disk. This behavior is still possible through install scripts. This vulnerability bypasses a user using the --ignore-scripts install option. Recommendation Upgrade to version 6.13.3 or later.

Related

Alias · CVE (1)

  • CVE-2019-16775 Versions of the npm CLI prior to 6.13.3 are vulnerable to an Arbitrary File Write. vulnerability

Weakness · CWE (2)

  • CWE-59 Improper Link Resolution Before File Access weakness
  • CWE-61 UNIX Symbolic Link (Symlink) Following weakness

References