vulnerabilityremediation.appFrom finding to proven fix

npm audit fix: what it changes, and what to do when it can't fix everything

npm audit fix installs the patched versions of vulnerable packages that still fit the ranges in your package.json, by running a full npm install. Anything that needs a new major version, or sits under a dependency pinned to an old range, stays reported. --force installs those majors anyway, and npm's own docs advise against it unless you know exactly why.

Published December 1, 2026 · Updated December 2, 2026. Commands, flags and quotations read from the npm CLI v12 documentation (latest 12.2.3) on December 1, 2026, and the KEV entries from CISA's catalog that day.

What does npm audit fix change?

Your lockfile and node_modules. It sends your dependency tree to the registry, gets the advisories that match, and installs versions without advisories that your package.json ranges still allow. It runs a full npm install to do it, so installer settings apply, and it needs a package-lock.json unless you pass --no-package-lock, in which case results can differ on each run.

CommandWhat it doesUse it when
npm auditReports, changes nothingBefore any fix, and after it
npm audit fix --dry-run --jsonShows what fix would installBefore you let it change anything
npm audit fixInstalls in-range patched versionsThe first real fix
npm audit fix --package-lock-onlyUpdates the lockfile, not node_modulesIn CI, or to review the diff
npm audit fix --omit=devSkips devDependencies (--only=prod, in npm's example, is the deprecated alias)Shipping code first
npm audit fix --forceAllows majors, outside your rangesRarely; see below
npm audit --audit-level=highFails only on high or criticalA CI gate

From the npm CLI v12 documentation (latest 12.2.3), read December 1, 2026.

Why is npm audit fix not working on some findings?

Because the fix needs a version your ranges don't allow, or no fixed version exists. npm says plainly that “some vulnerabilities cannot be fixed automatically and will require manual intervention or review.”

The usual cause is what npm calls a metavulnerability. Its own example: if foo is vulnerable from 1.0.2 up to 2.0.0 and bar depends on foo@^1.1.0, every install of that bar brings a vulnerable foo, so bar is reported too. When such a chain reaches your own package.json and can't be fixed without changing your ranges, npm audit fix stops and asks for --force.

Other reasons it reports the same findings again: there is no package-lock.json; the advisory has no patched version yet; or the package sits in devDependencies you told it to skip.

When is npm audit fix --force safe?

When you know which major versions it will install and your tests cover the code that uses them. --force lets npm audit fix install modules outside your stated range, including SemVer-major changes, and npm's own docs say: “If you don't have a clear idea of what you want to do, it is strongly recommended that you do not use this option!”

  1. Commit your lockfile so you can go back.
  2. Run npm audit fix --dry-run --json and list the majors it would install.
  3. Read those packages' changelogs for breaking changes.
  4. Run npm audit fix --force on a branch, then your full test suite.
  5. Open the change as a pull request so CI runs it again.

If one major is the problem, upgrade that parent by hand instead and leave the rest in range.

What do you do with what's left?

Pick one of four ways out, in this order: upgrade the direct dependency that pins the old range; override the nested version in your root package.json (pnpm overrides go in pnpm-workspace.yaml); replace or remove the package; or, if no fix exists, record the finding and set --audit-level so CI fails only on what you have decided to block. For a production app, the remediation deadlines say how long a known exploited flaw can wait, and tools that open the fix as a pull request can do the upgrade for you.

How do you prove the fix worked?

Run npm audit again. It exits with 0 when it finds no vulnerabilities, and npm audit fix exits with 0 when it fixed all of them; otherwise the exit code follows your audit-level. Then let CI run your tests on the lockfile change, and keep npm audit --audit-level=high in CI so a new high or critical advisory fails the build.

For the packages themselves, npm audit signatures checks the registry signatures and provenance attestations of what you downloaded.

Are npm packages on CISA's list of exploited vulnerabilities?

A few. A search of CISA's Known Exploited Vulnerabilities catalog on December 1, 2026 found 5 packages that ship on npm among its 1,810 entries, and 3 of them were added in 2026. Two of those three were malicious versions published to the registry, not coding mistakes.

Package, CVE, added to KEVWhat CISA describes
eslint-config-prettierCVE-2025-54313
added Jan 22, 2026
Installing an affected version runs an install script that launches malware on Windows
React Native Community CLICVE-2025-11953
added Feb 5, 2026
OS command injection through the Metro development server
TanStackCVE-2026-45321
added May 27, 2026
Malicious versions published to npm with credential-stealing malware
jQueryCVE-2020-11023
added Jan 23, 2025
Cross-site scripting through its DOM manipulators
systeminformationCVE-2021-21315
added Jan 18, 2022
Command injection through the name parameter

From CISA's KEV catalog, version 2026.11.30, read December 1, 2026. Found by searching names, descriptions and notes for npm, Node.js and package names, so the list may miss some.

For a malicious version, an upgrade isn't the whole fix: the bad version already ran when it was installed, so treat that machine and the secrets it could read as exposed. For the other kind, npm audit fix or an override does the job, as above.

Every KEV entry added in 2026, with its deadline, flags and NVD dates, is in the KEV 2026 additions dataset, kev-2026-additions.csv (326 rows, CC BY 4.0). The remediation guide sums it up.

How was this page checked?

Every command, flag and quotation was read from the npm CLI v12 documentation on December 1, 2026. The KEV rows come from CISA's catalog JSON and NVD's API, read the same day. Nothing was run against a real project. Errors: support@winding.ai.

  1. npm audit (npm CLI v12): description, examples, exit codes, metavulnerabilities, the force, dry-run, package-lock-only and audit-level settings, audit signatures
  2. npm CLI releases: latest version 12.2.3
  3. package.json: overrides (npm CLI v12)
  4. CISA Known Exploited Vulnerabilities catalog (JSON feed) and the NVD CVE API