Description
The npm ci command in npm 7.x and 8.x through 8.1.3 proceeds with an installation even if dependency information in package-lock.json differs from package.json. This behavior is inconsistent with the documentation, and makes it easier for attackers to install malware that was supposed to have been blocked by an exact version match requirement in package-lock.json. NOTE: The npm team believes this is not a vulnerability. It would require someone to socially engineer package.json which has different dependencies than package-lock.json. That user would have to have file system or write access to change dependencies. The npm team states preventing malicious actors from socially engineering or gaining file system access is outside the scope of the npm CLI.
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | npm | 8.4.1~ds-1 | — |
| Debian 13 | npm | 8.4.1~ds-1 | — |
| Debian 12 | npm | 8.4.1~ds-1 | — |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 26.10 | npm | No fix yet | — |
| Ubuntu 26.04 LTS | npm | No fix yet | — |
| Ubuntu 25.10 | npm | No fix yet | — |
| Ubuntu 24.04 LTS | npm | No fix yet | — |
| Ubuntu 22.04 LTS | npm | No fix yet | — |
Red Hat
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| RHEL 8 | nodejs +3 | 1:16.14.0-4.module+el8.6.0+15294+54b291d2 | RHSA-2022:4796 |
| RHEL 8 | nodejs-nodemon | 2.0.15-1.module+el8.6.0+15294+54b291d2 | RHSA-2022:4796 |
| RHEL 8 | nodejs-packaging | 25-1.module+el8.5.0+10992+fac5fe06 | RHSA-2022:4796 |
| RHEL 8 | npm | 1:8.3.1-1.16.14.0.4.module+el8.6.0+15294+54b291d2 | RHSA-2022:4796 |
AlmaLinux
Errata ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| AlmaLinux 8 | nodejs +3 | 1:16.14.0-4.module_el8.6.0+2904+f21ad6f4 | ALSA-2022:4796 |
| AlmaLinux 8 | nodejs-nodemon | 2.0.15-1.module_el8.5.0+2605+45d748af | ALSA-2022:4796 |
| AlmaLinux 8 | nodejs-packaging | 25-1.module_el8.5.0+246+05401605 | ALSA-2022:4796 |
| AlmaLinux 8 | npm | 1:8.3.1-1.16.14.0.4.module_el8.6.0+2904+f21ad6f4 | ALSA-2022:4796 |
Rocky Linux
Errata ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Rocky Linux 8 | nodejs | 1:16.14.0-4.module+el8.6.0+978+59f26232 | RLSA-2022:4796 |
| Rocky Linux 8 | nodejs-nodemon | 2.0.15-1.module+el8.5.0+721+4c107270 | RLSA-2022:4796 |
| Rocky Linux 8 | nodejs-packaging | 25-1.module+el8.5.0+702+221f14e6 | RLSA-2022:4796 |
Alpine
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine v3.24 | npm | 8.1.4-r0 | — |
| Alpine v3.23 | npm | 8.1.4-r0 | — |
| Alpine v3.22 | npm | 8.1.4-r0 | — |
| Alpine v3.21 | npm | 8.1.4-r0 | — |
| Alpine v3.20 | npm | 8.1.4-r0 | — |
Show 4 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine v3.19 | npm | 8.1.4-r0 | — |
| Alpine v3.18 | npm | 8.1.4-r0 | — |
| Alpine v3.17 | npm | 8.1.4-r0 | — |
| Alpine v3.16 | npm | 8.1.4-r0 | — |
Amazon Linux
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Amazon Linux 2023 | nodejs +4 | 1:18.12.1-1.amzn2023.0.2 | ALAS2023-2023-084 |
| Amazon Linux 2023 | npm | 1:8.19.2-1.18.12.1.1.amzn2023.0.2 | ALAS2023-2023-084 |
| Amazon Linux 2023 | v8-devel | 2:10.2.154.15-1.18.12.1.1.amzn2023.0.2 | ALAS2023-2023-084 |
Oracle Linux
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Oracle Linux 8 | nodejs +3 | 1:16.14.0-4.module+el8.6.0+20672+19f3909b | ELSA-2022-4796 |
| Oracle Linux 8 | nodejs-nodemon | 2.0.15-1.module+el8.6.0+20672+19f3909b | ELSA-2022-4796 |
| Oracle Linux 8 | nodejs-packaging | 25-1.module+el8.5.0+20388+4b61e68d | ELSA-2022-4796 |
| Oracle Linux 8 | npm | 1:8.3.1-1.16.14.0.4.module+el8.6.0+20672+19f3909b | ELSA-2022-4796 |
Public exploits
Exploit or proof-of-concept code for this vulnerability is publicly available, which lowers the bar for attackers. Treat it as a reason to patch sooner.
GitHub 1 repository
-
icatalina/CVE-2021-43616 ★ 3 · Nov 15, 2021
Repo demonstrating CVE-2021-43616 / https://github.com/npm/cli/issues/2701
Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.
Advisories 6
- ALSA-2022:4796 Important: nodejs:16 security update AlmaLinux Security Advisories · Oct 29, 2026
- RHSA-2022:4796 Red Hat Security Advisory: nodejs:16 security update Red Hat Security Advisories (RHSA) · Jul 3, 2026
- RLSA-2022:4796 Important: nodejs:16 security update Rocky Linux Security Advisories · Feb 4, 2026
- ALAS2023-2023-084 Important: nodejs security update (Amazon Linux 2023) Amazon Linux Security Center (ALAS) · Feb 22, 2023
- WID-SEC-2022-2278 npm: Schwachstelle ermöglicht Umgehen von Sicherheitsvorkehrungen BSI CERT-Bund (WID) · Dec 11, 2022
- ELSA-2022-4796 Important: nodejs:16 security update (Oracle Linux 8) Oracle Linux Security Advisories (ELSA) · May 30, 2022
References
- https://github.com/npm/cli/issues/2701
- https://docs.npmjs.com/cli/v7/commands/npm-ci
- https://github.com/icatalina/CVE-2021-43616
- https://medium.com/cider-sec/this-time-we-were-lucky-85c0dcac94a0
- https://security.netapp.com/advisory/ntap-20211210-0002/
- https://github.com/npm/cli/commit/457e0ae61bbc55846f5af44afa4066921923490f
- FEDORA-2022-97b214b298 vendor-advisory
- https://docs.npmjs.com/cli/v8/commands/npm-ci
- https://github.com/npm/cli/issues/2701#issuecomment-979054224
- https://github.com/npm/cli/issues/2701#issuecomment-972900511