CVE-2021-43616
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.
What to do
Fixed builds are available from AlmaLinux, Alpine, Debian, Red Hat, Rocky Linux: see the table below for the fixed version per release.
Ubuntu has not shipped a fix for every release yet.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 26.10 | npm | Fix pending | UBUNTU-CVE-2021-43616 | |
| Ubuntu 26.04 | npm | Fix pending | UBUNTU-CVE-2021-43616 | |
| Ubuntu 25.10 | npm | Will not fix Ubuntu decided not to fix this in this release | UBUNTU-CVE-2021-43616 | |
| Ubuntu 24.04 | npm | Fix pending | UBUNTU-CVE-2021-43616 | |
| Ubuntu 22.04 | npm | Fix pending | UBUNTU-CVE-2021-43616 | |
| Ubuntu 20.04 | npm | Not affected vulnerable_code_not_present | ||
| Ubuntu 16.04 | npm | Will not fix Ubuntu decided not to fix this in this release | ||
| Ubuntu 14.04 | npm | Will not fix Ubuntu decided not to fix this in this release | ||
| Debian 14 | npm | Fixed | 8.4.1~ds-1 | DEBIAN-CVE-2021-43616 |
| Debian 13 | npm | Fixed | 8.4.1~ds-1 | DEBIAN-CVE-2021-43616 |
| Debian 12 | npm | Fixed | 8.4.1~ds-1 | DEBIAN-CVE-2021-43616 |
| Red Hat Enterprise Linux 9 | nodejs | Not affected | ||
| Red Hat Enterprise Linux 9 | nodejs-docs | Not affected | ||
| Red Hat Enterprise Linux 9 | nodejs-full-i18n | Not affected | ||
| Red Hat Enterprise Linux 9 | nodejs-libs | Not affected | ||
| Red Hat Enterprise Linux 9 | npm | Not affected | ||
| Red Hat Enterprise Linux 8 | nodejs | Fixed | 1:16.14.0-4.module+el8.6.0+15294+54b291d2 | RHSA-2022:4796 |
| Red Hat Enterprise Linux 8 | nodejs-devel | Fixed | 1:16.14.0-4.module+el8.6.0+15294+54b291d2 | RHSA-2022:4796 |
| Red Hat Enterprise Linux 8 | nodejs-docs | Fixed | 1:16.14.0-4.module+el8.6.0+15294+54b291d2 | RHSA-2022:4796 |
| Red Hat Enterprise Linux 8 | nodejs-full-i18n | Fixed | 1:16.14.0-4.module+el8.6.0+15294+54b291d2 | RHSA-2022:4796 |
| Red Hat Enterprise Linux 8 | nodejs-libs | Not affected | ||
| Red Hat Enterprise Linux 8 | nodejs-nodemon | Fixed | 0:2.0.15-1.module+el8.6.0+15294+54b291d2 | RHSA-2022:4796 |
| Red Hat Enterprise Linux 8 | nodejs-packaging | Fixed | 0:25-1.module+el8.5.0+10992+fac5fe06 | RHSA-2022:4796 |
| Red Hat Enterprise Linux 8 | nodejs-packaging-bundler | Not affected | ||
| Red Hat Enterprise Linux 8 | npm | Fixed | 1:8.3.1-1.16.14.0.4.module+el8.6.0+15294+54b291d2 | RHSA-2022:4796 |
| Red Hat Enterprise Linux 8 | v8-12.4-devel | Not affected | ||
| Red Hat Enterprise Linux 8 | v8-13.6-devel | Not affected | ||
| AlmaLinux 8 | nodejs | Fixed | 1:16.14.0-4.module_el8.6.0+2904+f21ad6f4 | ALSA-2022:4796 |
| AlmaLinux 8 | nodejs-devel | Fixed | 1:16.14.0-4.module_el8.6.0+2904+f21ad6f4 | ALSA-2022:4796 |
| AlmaLinux 8 | nodejs-docs | Fixed | 1:16.14.0-4.module_el8.6.0+2904+f21ad6f4 | ALSA-2022:4796 |
| AlmaLinux 8 | nodejs-full-i18n | Fixed | 1:16.14.0-4.module_el8.6.0+2904+f21ad6f4 | ALSA-2022:4796 |
| AlmaLinux 8 | nodejs-nodemon | Fixed | 2.0.15-1.module_el8.6.0+2904+f21ad6f4 | ALSA-2022:4796 |
| AlmaLinux 8 | nodejs-packaging | Fixed | 25-1.module_el8.5.0+2605+45d748af | ALSA-2022:4796 |
| AlmaLinux 8 | npm | Fixed | 1:8.3.1-1.16.14.0.4.module_el8.6.0+2904+f21ad6f4 | ALSA-2022:4796 |
| Rocky Linux 8 | nodejs | Fixed | 1:16.14.0-4.module+el8.6.0+978+59f26232 | RLSA-2022:4796 |
| Rocky Linux 8 | nodejs-nodemon | Fixed | 0:2.0.15-1.module+el8.5.0+721+4c107270 | RLSA-2022:4796 |
| Rocky Linux 8 | nodejs-packaging | Fixed | 0:25-1.module+el8.6.0+1046+80feca58 | RLSA-2022:4796 |
| Alpine Linux 3.24 | npm | Fixed | 8.1.4-r0 | ALPINE-CVE-2021-43616 |
| Alpine Linux 3.23 | npm | Fixed | 8.1.4-r0 | ALPINE-CVE-2021-43616 |
| Alpine Linux 3.22 | npm | Fixed | 8.1.4-r0 | ALPINE-CVE-2021-43616 |
| Alpine Linux 3.21 | npm | Fixed | 8.1.4-r0 | ALPINE-CVE-2021-43616 |
| Alpine Linux 3.20 | npm | Fixed | 8.1.4-r0 | ALPINE-CVE-2021-43616 |
| Alpine Linux 3.19 | npm | Fixed | 8.1.4-r0 | ALPINE-CVE-2021-43616 |
| Alpine Linux 3.18 | npm | Fixed | 8.1.4-r0 | ALPINE-CVE-2021-43616 |
| Alpine Linux 3.17 | npm | Fixed | 8.1.4-r0 | ALPINE-CVE-2021-43616 |
| Alpine Linux 3.16 | npm | Fixed | 8.1.4-r0 | ALPINE-CVE-2021-43616 |
What the vendor says
As published in the CVE record by mitre, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
Vendor advisories:
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/… (vendor-advisory)
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
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/NXNVFKOF5ZYH5NIRWHKN6O6UBCHDV6FE/
- 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
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.