NodeJS/npm/7.20.1
a package manager for JavaScript
https://www.npmjs.com/package/npm
Artistic-2.0
2 Security Vulnerabilities
npm cli Uncontrolled Search Path Element Local Privilege Escalation Vulnerability
npm cli Incorrect Permission Assignment Local Privilege Escalation Vulnerability. This vulnerability allows local attackers to escalate privileges on affected installations of npm cli. An attacker must first obtain the ability to execute low-privileged code on the target system in order to exploit this vulnerability.
The specific flaw exists within the handling of modules. The application loads modules from an unsecured location. An attacker can leverage this vulnerability to escalate privileges and execute arbitrary code in the context of a target user.
Packing does not respect root-level ignore files in workspaces
- https://github.com/npm/cli/security/advisories/GHSA-hj9c-8jmm-8c52
- https://github.com/nodejs/node/releases/tag/v16.15.1
- https://github.com/nodejs/node/releases/tag/v17.9.1
- https://github.com/nodejs/node/releases/tag/v18.3.0
- https://github.com/npm/cli/releases/tag/v8.11.0
- https://github.com/npm/cli/tree/latest/workspaces/libnpmpack
- https://github.com/npm/cli/tree/latest/workspaces/libnpmpublish
- https://github.com/npm/npm-packlist
- https://github.com/advisories/GHSA-hj9c-8jmm-8c52
- https://nvd.nist.gov/vuln/detail/CVE-2022-29244
- https://github.com/nodejs/node/pull/43210
- https://security.netapp.com/advisory/ntap-20220722-0007/
Impact
npm pack ignores root-level .gitignore & .npmignore file exclusion directives when run in a workspace or with a workspace flag (ie. --workspaces, --workspace=<name>). Anyone who has run npm pack or npm publish with workspaces, as of v7.9.0 & v7.13.0 respectively, may be affected and have published files into the npm registry they did not intend to include.
Patch
- Upgrade to the latest, patched version of
npm(v8.11.0or greater), run:npm i -g npm@latest - Node.js versions
v16.15.1,v17.19.1&v18.3.0include the patchedv8.11.0version ofnpm
Steps to take to see if you're impacted
- Run
npm publish --dry-runornpm packwith annpmversion>=7.9.0&<8.11.0inside the project's root directory using a workspace flag like:--workspacesor--workspace=<name>(ex.npm pack --workspace=foo) - Check the output in your terminal which will list the package contents (note:
tar -tvf <package-on-disk>also works) - If you find that there are files included you did not expect, you should: 3.1. Create & publish a new release excluding those files (ref.
Keeping files out of your Package
) 3.2. Deprecate the old package (ex.npm deprecate <pkg>[@<version>] <message>) 3.3. Revoke or rotate any sensitive information (ex. passwords, tokens, secrets etc.) which might have been exposed ### References - CVE-2022-29244
npm-packlistlibnpmpacklibnpmpublish
577 Other Versions
| Version | License | Security | Released | |
|---|---|---|---|---|
| 7.0.0-rc.4 | Artistic-2.0 | 1 | 2020-10-09 - 18:51 | over 5 years |
| 7.0.0-rc.3 | Artistic-2.0 | 1 | 2020-10-06 - 18:58 | over 5 years |
| 7.0.0-rc.2 | Artistic-2.0 | 1 | 2020-10-02 - 23:59 | over 5 years |
| 7.0.0-rc.1 | Artistic-2.0 | 1 | 2020-10-02 - 21:23 | over 5 years |
| 7.0.0-rc.0 | Artistic-2.0 | 1 | 2020-10-01 - 14:45 | over 5 years |
| 7.0.0-beta.13 | Artistic-2.0 | 1 | 2020-09-29 - 18:59 | over 5 years |
| 7.0.0-beta.12 | Artistic-2.0 | 1 | 2020-09-22 - 19:03 | over 5 years |
| 7.0.0-beta.11 | Artistic-2.0 | 1 | 2020-09-16 - 16:01 | over 5 years |
| 7.0.0-beta.10 | Artistic-2.0 | 1 | 2020-09-08 - 17:32 | over 5 years |
| 7.0.0-beta.9 | Artistic-2.0 | 1 | 2020-09-04 - 19:18 | over 5 years |
| 7.0.0-beta.8 | Artistic-2.0 | 1 | 2020-09-01 - 19:25 | over 5 years |
| 7.0.0-beta.7 | Artistic-2.0 | 1 | 2020-08-25 - 18:53 | over 5 years |
| 7.0.0-beta.6 | Artistic-2.0 | 1 | 2020-08-21 - 18:48 | over 5 years |
| 7.0.0-beta.5 | Artistic-2.0 | 1 | 2020-08-18 - 19:08 | over 5 years |
| 7.0.0-beta.4 | Artistic-2.0 | 1 | 2020-08-11 - 16:06 | over 5 years |
| 7.0.0-beta.3 | Artistic-2.0 | 1 | 2020-08-10 - 21:50 | over 5 years |
| 7.0.0-beta.2 | Artistic-2.0 | 1 | 2020-08-07 - 18:38 | over 5 years |
| 7.0.0-beta.1 | Artistic-2.0 | 1 | 2020-08-05 - 19:26 | over 5 years |
| 7.0.0-beta.0 | Artistic-2.0 | 1 | 2020-08-04 - 20:09 | over 5 years |
| 6.14.18 | Artistic-2.0 | 1 | 2022-12-21 - 20:27 | about 3 years |
| 6.14.17 | Artistic-2.0 | 1 | 2022-04-28 - 20:38 | almost 4 years |
| 6.14.16 | Artistic-2.0 | 1 | 2022-01-19 - 20:41 | about 4 years |
| 6.14.15 | Artistic-2.0 | 1 | 2021-08-24 - 02:53 | over 4 years |
| 6.14.14 | Artistic-2.0 | 1 | 2021-07-27 - 19:19 | over 4 years |
| 6.14.13 | Artistic-2.0 | 1 | 2021-04-12 - 15:16 | almost 5 years |
| 6.14.12 | Artistic-2.0 | 1 | 2021-03-25 - 21:19 | almost 5 years |
| 6.14.11 | Artistic-2.0 | 1 | 2021-01-08 - 02:20 | about 5 years |
| 6.14.10 | Artistic-2.0 | 1 | 2020-12-18 - 19:37 | about 5 years |
| 6.14.9 | Artistic-2.0 | 1 | 2020-11-20 - 20:49 | about 5 years |
| 6.14.8 | Artistic-2.0 | 1 | 2020-08-17 - 20:50 | over 5 years |
| 6.14.7 | Artistic-2.0 | 1 | 2020-07-21 - 20:19 | over 5 years |
| 6.14.6 | Artistic-2.0 | 1 | 2020-07-07 - 17:14 | over 5 years |
| 6.14.5 | Artistic-2.0 | 2 | 2020-05-04 - 16:46 | almost 6 years |
| 6.14.4 | Artistic-2.0 | 2 | 2020-03-25 - 15:46 | almost 6 years |
| 6.14.3 | Artistic-2.0 | 2 | 2020-03-19 - 15:11 | almost 6 years |
| 6.14.2 | Artistic-2.0 | 2 | 2020-03-03 - 18:36 | almost 6 years |
| 6.14.1 | Artistic-2.0 | 2 | 2020-02-27 - 00:40 | almost 6 years |
| 6.14.0 | Artistic-2.0 | 2 | 2020-02-25 - 19:07 | almost 6 years |
| 6.13.7 | Artistic-2.0 | 2 | 2020-01-28 - 19:09 | about 6 years |
| 6.13.6 | Artistic-2.0 | 2 | 2020-01-09 - 23:00 | about 6 years |
| 6.13.5 | Artistic-2.0 | 2 | 2020-01-09 - 21:14 | about 6 years |
| 6.13.4 | Artistic-2.0 | 2 | 2019-12-11 - 19:05 | about 6 years |
| 6.13.3 | Artistic-2.0 | 3 | 2019-12-10 - 01:31 | about 6 years |
| 6.13.2 | Artistic-2.0 | 5 | 2019-12-03 - 17:55 | about 6 years |
| 6.13.1 | Artistic-2.0 | 5 | 2019-11-18 - 18:46 | about 6 years |
| 6.13.0 | Artistic-2.0 | 5 | 2019-11-05 - 19:47 | over 6 years |
| 6.12.1 | Artistic-2.0 | 5 | 2019-10-29 - 16:48 | over 6 years |
| 6.12.0 | Artistic-2.0 | 5 | 2019-10-08 - 15:43 | over 6 years |
| 6.12.0-next.0 | Artistic-2.0 | 5 | 2019-09-26 - 19:06 | over 6 years |
| 6.11.3 | Artistic-2.0 | 5 | 2019-09-03 - 22:18 | over 6 years |
