CVE-2019-16776: Unauthorized File Access in npm CLI before before version 6.13.3
Versions of the npm CLI prior to 6.13.3 are vulnerable to a symlink reference outside of nodemodules. It is possible for packages to create symlinks to files outside of thenodemodules folder through the bin field upon installation. A properly constructed entry in the package.json bin field would allow a package publisher to create a symlink pointing to arbitrary files on a user’s system when the package is installed. Only files accessible by the user running the npm install are affected.
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.
Other sources
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 nodemodules 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 overwrite files that already exist on disk.
References:
https://www.npmjs.com/advisories/1434 https://nodejs.org/en/blog/vulnerability/december-2019-security-releases/ https://blog.npmjs.org/post/189618601100/binary-planting-with-the-npm-cli
— Red Hat
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 nodemodules folder through the bin field. A properly constructed entry in the package.json bin field would allow a package publisher to modify and/or gain access to arbitrary files on a user's system when the package is installed. This behavior is still possible through install scripts. This vulnerability bypasses a user using the --ignore-scripts install option.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
redhat/rh-nodejs10-nodejsto a version that resolves this vulnerability.Fixed in 0:10.19.0-1.el7 - Upgrade
Upgrade
redhat/rh-nodejs12-nodejsto a version that resolves this vulnerability.Fixed in 0:12.16.1-1.el7 - Upgrade
Upgrade
redhat/rh-nodejs8-nodejsto a version that resolves this vulnerability.Fixed in 0:8.17.0-2.el7 - Upgrade
Upgrade
redhat/npmto a version that resolves this vulnerability.Fixed in 6.13.3 - Upgrade
Upgrade
redhat/nodejsto a version that resolves this vulnerability.Fixed in 8.17.0 - Upgrade
Upgrade
redhat/nodejsto a version that resolves this vulnerability.Fixed in 10.18.0 - Upgrade
Upgrade
redhat/nodejsto a version that resolves this vulnerability.Fixed in 12.14.0 - Upgrade
Upgrade
redhat/nodejsto a version that resolves this vulnerability.Fixed in 13.4.0 - Upgrade
Upgrade
npm/npmto a version that resolves this vulnerability.Fixed in 6.13.3 - Upgrade
Upgrade
debian/npmto a version that resolves this vulnerability.Fixed in 6.13.4+ds-1Fixed in 5.8.0+ds6-4+deb10u1Fixed in 6.13.4+ds-2 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 6.13.3
Event History
Parent advisories
This vulnerability appears in the following advisories.
Frequently Asked Questions
What is the vulnerability ID for this issue?
The vulnerability ID for this issue is CVE-2019-16776.
What is the severity of CVE-2019-16776?
The severity of CVE-2019-16776 is high (8.1).
Which versions of the npm CLI are affected?
Versions of the npm CLI prior to 6.13.3 are affected.
How can I fix CVE-2019-16776?
To fix CVE-2019-16776, make sure to update the npm CLI to version 6.13.3 or later.
Where can I find more information about CVE-2019-16776?
More information about CVE-2019-16776 can be found at the following references: [npm advisory](https://www.npmjs.com/advisories/1434), [Node.js blog](https://nodejs.org/en/blog/vulnerability/december-2019-security-releases/), [npm blog](https://blog.npmjs.org/post/189618601100/binary-planting-with-the-npm-cli).