Vulnerabilities / CVE-2021-43616

critical

CVE-2021-43616

npm: npm ci succeeds when package-lock.json doesn't match package.json

Published Modified CWE 345
In the Trivy database since at least 24 Oct 2026, 07:11 UTCWhen it arrived before that build is not recorded.

Severity by source

NVD9.8CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Red Hat8.1CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H

Trivy's own label is CRITICAL. Rated critical by NVD. Rated lower by Red Hat (high), AlmaLinux (high), Amazon (high), Oracle (high), Rocky Linux (high), Ubuntu (medium).

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.

Affected packages and fixed versions

SourcePackageFixed in
alma 8nodejs:16::nodejs, nodejs:16::nodejs-devel, nodejs:16::nodejs-docs and 4 more1:16.14.0-4.module_el8.6.0+2904+f21ad6f4 and 3 more
alpine 3.16npm8.1.4-r0
alpine 3.17npm8.1.4-r0
alpine 3.18npm8.1.4-r0
alpine 3.19npm8.1.4-r0
alpine 3.20npm8.1.4-r0
alpine 3.21npm8.1.4-r0
alpine 3.22npm8.1.4-r0
alpine 3.23npm8.1.4-r0
alpine 3.24npm8.1.4-r0
alpine edgenpm8.1.4-r0
amazon linux 2022nodejs, nodejs-debuginfo, nodejs-debugsource and 7 more1:18.4.0-1.amzn2022.0.2 and 2 more
Show all 70 entries from 29 sources
SourcePackageFixed in
alma 8nodejs:16::nodejs1:16.14.0-4.module_el8.6.0+2904+f21ad6f4
alma 8nodejs:16::nodejs-devel1:16.14.0-4.module_el8.6.0+2904+f21ad6f4
alma 8nodejs:16::nodejs-docs1:16.14.0-4.module_el8.6.0+2904+f21ad6f4
alma 8nodejs:16::nodejs-full-i18n1:16.14.0-4.module_el8.6.0+2904+f21ad6f4
alma 8nodejs:16::nodejs-nodemon2.0.15-1.module_el8.5.0+2605+45d748af
alma 8nodejs:16::nodejs-packaging25-1.module_el8.5.0+246+05401605
alma 8nodejs:16::npm1:8.3.1-1.16.14.0.4.module_el8.6.0+2904+f21ad6f4
alpine 3.16npm8.1.4-r0
alpine 3.17npm8.1.4-r0
alpine 3.18npm8.1.4-r0
alpine 3.19npm8.1.4-r0
alpine 3.20npm8.1.4-r0
alpine 3.21npm8.1.4-r0
alpine 3.22npm8.1.4-r0
alpine 3.23npm8.1.4-r0
alpine 3.24npm8.1.4-r0
alpine edgenpm8.1.4-r0
amazon linux 2022nodejs1:18.4.0-1.amzn2022.0.2
amazon linux 2022nodejs-debuginfo1:18.4.0-1.amzn2022.0.2
amazon linux 2022nodejs-debugsource1:18.4.0-1.amzn2022.0.2
amazon linux 2022nodejs-devel1:18.4.0-1.amzn2022.0.2
amazon linux 2022nodejs-docs1:18.4.0-1.amzn2022.0.2
amazon linux 2022nodejs-full-i18n1:18.4.0-1.amzn2022.0.2
amazon linux 2022nodejs-libs1:18.4.0-1.amzn2022.0.2
amazon linux 2022nodejs-libs-debuginfo1:18.4.0-1.amzn2022.0.2
amazon linux 2022npm1:8.12.1-1.18.4.0.1.amzn2022.0.2
amazon linux 2022v8-devel2:10.2.154.4-1.18.4.0.1.amzn2022.0.2
amazon linux 2023nodejs1:18.12.1-1.amzn2023.0.2
amazon linux 2023nodejs-debuginfo1:18.12.1-1.amzn2023.0.2
amazon linux 2023nodejs-debugsource1:18.12.1-1.amzn2023.0.2
amazon linux 2023nodejs-devel1:18.12.1-1.amzn2023.0.2
amazon linux 2023nodejs-docs1:18.12.1-1.amzn2023.0.2
amazon linux 2023nodejs-full-i18n1:18.12.1-1.amzn2023.0.2
amazon linux 2023nodejs-libs1:18.12.1-1.amzn2023.0.2
amazon linux 2023nodejs-libs-debuginfo1:18.12.1-1.amzn2023.0.2
amazon linux 2023npm1:8.19.2-1.18.12.1.1.amzn2023.0.2
amazon linux 2023v8-devel2:10.2.154.15-1.18.12.1.1.amzn2023.0.2
debian 10npmno fix listed
debian 11npmno fix listed
debian 12npm8.4.1~ds-1
debian 13npm8.4.1~ds-1
debian 14npm8.4.1~ds-1
echonpm8.4.1~ds-1
Oracle Linux 8nodejs1:16.14.0-4.module+el8.6.0+20672+19f3909b
Oracle Linux 8nodejs-devel1:16.14.0-4.module+el8.6.0+20672+19f3909b
Oracle Linux 8nodejs-docs1:16.14.0-4.module+el8.6.0+20672+19f3909b
Oracle Linux 8nodejs-full-i18n1:16.14.0-4.module+el8.6.0+20672+19f3909b
Oracle Linux 8nodejs-nodemon2.0.15-1.module+el8.6.0+20672+19f3909b
Oracle Linux 8nodejs-packaging25-1.module+el8.5.0+20388+4b61e68d
Oracle Linux 8npm1:8.3.1-1.16.14.0.4.module+el8.6.0+20672+19f3909b
rapidfort amazon linux 2023nodejs1:18.12.1-1.amzn2023.0.2
rapidfort ubuntu 20.04npmno fix listed
rapidfort ubuntu 22.04npmno fix listed
rapidfort ubuntu 24.04npmno fix listed
rocky 8nodejs1:16.14.0-4.module+el8.6.0+978+59f26232
rocky 8nodejs-devel1:16.14.0-4.module+el8.6.0+978+59f26232
rocky 8nodejs-docs1:16.14.0-4.module+el8.6.0+978+59f26232
rocky 8nodejs-full-i18n1:16.14.0-4.module+el8.6.0+978+59f26232
rocky 8nodejs:16::nodejs1:16.14.0-4.module+el8.6.0+978+59f26232
rocky 8nodejs:16::nodejs-devel1:16.14.0-4.module+el8.6.0+978+59f26232
rocky 8nodejs:16::nodejs-docs1:16.14.0-4.module+el8.6.0+978+59f26232
rocky 8nodejs:16::nodejs-full-i18n1:16.14.0-4.module+el8.6.0+978+59f26232
rocky 8nodejs:16::nodejs-nodemon2.0.15-1.module+el8.5.0+721+4c107270
rocky 8nodejs:16::nodejs-packaging25-1.module+el8.6.0+1046+80feca58
rocky 8nodejs:16::npm1:8.3.1-1.16.14.0.4.module+el8.6.0+978+59f26232
rocky 8npm1:8.3.1-1.16.14.0.4.module+el8.6.0+978+59f26232
ubuntu 22.04npmno fix listed
ubuntu 24.04npmno fix listed
ubuntu 26.04npmno fix listed
ubuntu 26.10npmno fix listed

References

All 19 references

Vulnerability data compiled from the Trivy vulnerability database (trivy-db, Aqua Security, Apache License 2.0), which aggregates third-party advisories. CVE records are published by The MITRE Corporation under the CVE Terms of Use; CVE is a trademark of MITRE. This product uses data from the NVD API but is not endorsed or certified by the NVD. Severity, titles and advisory data from the GitHub Advisory Database (CC BY 4.0), Red Hat security data (CC BY 4.0) and the other sources linked on each entry. Entries may be summarised or re-formatted; the linked original is the authoritative record.