← back
CVE-2019-16777

Arbitrary File Overwrite in npm CLI

CVSS 7.7 HIGHEPSS 2.0%CWE-22
In short

npm before version 6.13.4 allows packages to overwrite existing programs installed on your computer. An attacker can replace legitimate tools with malicious versions without your knowledge.

Technical detail

CWE-22 path traversal vulnerability in npm CLI (<6.13.4) allows arbitrary file overwrite of globally-installed binaries during package installation. The vulnerability persists despite --ignore-scripts flag and can be exploited during normal package installation workflows, enabling binary substitution attacks.

Summary generated and translated by AI from the official description.
Versions of the npm CLI prior to 6.13.4 are vulnerable to an Arbitrary File Overwrite. It fails to prevent existing globally-installed binaries to be overwritten by other package installations. For example, if a package was installed globally and created a serve binary, any subsequent installs of packages that also create a serve binary would overwrite the previous serve binary. This behavior is still allowed in local installations and also through install scripts. This vulnerability bypasses a user using the --ignore-scripts install option.
CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:H/I:H/A:N
Affected products
npm · cli

Want to know if your infrastructure is exposed to this?

Talk to TrueHacking →