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

Critical · published November 13, 2021

CVSS v3.1
9.0
EPSS
3%
Percentile
85.9
In the wild
Unconfirmed
What it is

🔥 An npm command that installs dependencies even if they don't match the locked versions could open the door to malicious packages! Think of it like a restaurant that serves a dish you ordered, but the chef decides to throw in some mystery ingredients without checking the recipe — it might taste fine, but you never know what's in it! This inconsistency could lead to attackers sneaking in malicious code that should have been blocked, potentially compromising your entire project. Imagine unwittingly turning your application into a vector for malware — that's absolutely devastating!

Put simply

Think of it like a restaurant that serves a dish you ordered, but the chef decides to throw in some mystery ingredients without checking the recipe — it might taste fine, but you never know what's in it! The CVE-2021-43616 flaw occurs when the npm ci command in versions 7.x and 8.x proceeds with installation, even if the dependency information in package-lock.json doesn't match package.json, which allows for the installation of unwanted packages.

What to do

This inconsistency could lead to attackers sneaking in malicious code that should have been blocked, potentially compromising your entire project. Imagine unwittingly turning your application into a vector for malware — that's absolutely devastating! To secure your environment, audit your package files regularly and ensure no unauthorized changes have been made. Avoid using npm versions 7.x through 8.1.3 in sensitive environments, and consider upgrading to npm 8.1.4 or later where this issue is not present. Always maintain strict file system permissions to prevent unauthorized access. You've got this! By taking these steps, you can strengthen your project's security and keep it safe from unwanted surprises! 🛡️

The record
Technical detail
CVSS v3.1
9.0 · CRITICAL
Vector
CVSS:3.1/AC:H/AV:N/A:H/C:H/I:H/PR:N/S:C/UI:N
CVSS v4.0
Not supplied
EPSS
0.02724 · 85.9th percentile
Published
2021-11-13T00:00Z
EPSS history
Timeline
  • 13 NOV 00:00Z
    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
    cvelistv5