Back to glossary

Patch Management

Patch management is the process of finding, testing, deploying, and verifying software updates that fix bugs and security vulnerabilities.

Also known as Patching, Software patch management, Security patching, Enterprise patch management

Patch management, also called patching, is the process of finding, prioritizing, testing, deploying, and verifying the updates that fix bugs and vulnerabilities in software you run. For operating systems, patches arrive from one vendor on a schedule. For open source dependencies, a patch is a new package version, so the update channel is also an attack channel.

Most patch management guidance assumes the patch comes from a party you already trust. Open source dependencies break that assumption. To a package manager, a security fix and a malicious release look the same: a new version number inside a range you already accepted. In the Qix compromise on September 8, 2025, attackers published 18 malicious npm versions in 8 minutes and 21 seconds, and a 19th that afternoon. Every one was a semantic versioning patch release, one number above the version before it.

Our position: patch management for dependencies has to separate taking a fix from taking new upstream code. Let a patch reach production only through a reviewed lockfile change. Triage with reachability analysis and evidence of exploitation, not severity scores. Hold routine updates behind a dependency cooldown while something inspects what each new version actually contains. When an upgrade is too risky or does not exist, backport the fix into the version you already run. A CVE feed cannot do that inspection, because malware does not get a CVE.

What is patch management?

#

Patch management is the loop that turns a vendor's fix into a verified change on every system you run. NIST's SP 800-40 Revision 4, published in April 2022, defines enterprise patch management as "the process of identifying, prioritizing, acquiring, installing, and verifying the installation of patches, updates, and upgrades throughout an organization." Software patch management is the same loop applied to applications and the libraries inside them.

A patch is any change that fixes a defect in software that is already deployed. It can be a hotfix for one bug, a monthly cumulative update for an operating system, a firmware image, or a new release of an open source library. Many patches close security vulnerabilities. Others fix crashes, data corruption, or performance regressions, and they go through the same pipeline.

For commercial software, the vendor sets the rhythm. Microsoft has released Windows fixes on the second Tuesday of each month since October 2003, a schedule known as Patch Tuesday, as The Register noted on its 20th anniversary. A fixed cadence lets IT teams book maintenance windows, test on a small group, and roll out in waves.

NIST describes four maintenance plans that a patch management program needs:

  • Routine patching for patches that ship on a regular release cycle.
  • Emergency patching for a crisis, such as a vulnerability under active exploitation.
  • Emergency mitigation when no patch exists yet, using configuration changes or other workarounds.
  • Unpatchable assets, which get isolation or other compensating controls because no fix will arrive.

For routine patches, NIST recommends phased deployments in which "a small subset of the assets to be patched receive the patch first." Those canary assets surface breakage before the rest of the fleet installs the patch. NIST is blunt about the trade-off every program has to make: "Deploying patches more quickly reduces the window of opportunity for attackers but increases the risk of operational disruption because of the lack of testing."

Why is patch management important?

#

Patch management is important because attackers exploit published flaws faster than most organizations deploy the fix. A public patch tells every attacker exactly where to look.

The Equifax breach is the standard example, and the unpatched component was an open source dependency. According to the Government Accountability Office's report, attackers used a vulnerability in the Apache Struts web framework to reach Equifax's online dispute portal on March 10, 2017, two days after US-CERT publicly identified the flaw. The attack lasted about 76 days before Equifax discovered it. It exposed data on at least 145.5 million people.

Deadlines have tightened since. CISA's Binding Operational Directive 26-04, issued in June 2026, gives federal agencies three days to fix known-exploited, automatable vulnerabilities on publicly exposed assets, as SecurityWeek reported.

The supply of patches is also outgrowing the people who apply them. 48,185 CVEs were published in 2025, up 20.6% from 2024. NIST, which runs the National Vulnerability Database, stopped enriching most CVEs in April 2026. In May 2026, curl's lead developer reported security reports arriving at four to five times the 2024 rate, as we noted in our coverage of the White House's Gold Eagle initiative.

A program that patches every finding by severity score will not keep up. Most dependency CVEs are not reachable from the application that ships them. Socket's full application reachability typically marks about 80% of them as unreachable, according to our launch post. Vulnerability management decides what is worth fixing. Patch management decides how the fix gets in.

How does a dependency patch reach your application?

#

A dependency patch reaches your application only when your lockfile changes. Publishing a fixed version changes nothing for a project until something re-resolves its dependency graph and writes the result down.

Start with how a dependency is declared. npm saves new dependencies with a caret range by default, and ^4.17.21 means any version from 4.17.21 up to, but not including, 5.0.0. The design is deliberate: a maintainer can ship a bug fix to every dependent without anyone editing a manifest. The lockfile then records the exact version that resolution picked, so later installs replay it.

We ran the sequence in an empty project with npm 10.9.9 on November 7, 2026:

Bash
$ npm config get save-prefix
^
$ npm install lodash@4.17.21
added 1 package in 470ms
$ grep lodash package.json
    "lodash": "^4.17.21"
$ npm outdated
Package  Current  Wanted  Latest  Location             Depended by
lodash   4.17.21  4.18.1  4.18.1  node_modules/lodash  demo
$ npm ci && npm ls lodash | grep lodash@
`-- lodash@4.17.21
$ npm audit fix
changed 1 package, and audited 2 packages in 666ms
found 0 vulnerabilities
$ npm ls lodash | grep lodash@
`-- lodash@4.18.1

The range has wanted lodash 4.18.1 since April 1, 2026. npm ci still installs 4.17.21, and it will keep doing so indefinitely. The fix arrived only when npm audit fix rewrote package-lock.json. In practice, that rewrite comes from npm update, npm audit fix, or an automated dependency update bot that opens a pull request. That pull request is the real control point for application code. It is the only moment new third-party code enters a build that installs from the lockfile.

Exact pins move the same decision into package.json. With "lodash": "4.17.21" in the manifest, npm treats the security release as a forced change:

Plain text
$ npm audit
# npm audit report

lodash  4.0.0 - 4.17.23
Severity: high
lodash vulnerable to Code Injection via `_.template` imports key names - https://github.com/advisories/GHSA-r5fr-rjxr-66jc
Lodash has Prototype Pollution Vulnerability in `_.unset`, `_.omit`, and `_.pullAt` functions - https://github.com/advisories/GHSA-xxjr-mmjv-4gpg
fix available via `npm audit fix --force`
Will install lodash@4.18.1, which is outside the stated dependency range
node_modules/lodash

We recommended exact versions in 2024 because they make every change explicit. The cost is that routine security fixes become manual work, so pinning holds up only with a bot that proposes the bumps. For a transitive dependency, you control neither the range nor the release. The parent package's declared range decides whether a fix can land at all.

The figure compares the two pipelines step by step. A vendor operating system patch goes from (1) a fix signed by one accountable publisher, to (2) a fixed monthly schedule, to (3) canary assets, to (4) a staged rollout in maintenance windows, to (5) verified installation. An open source dependency patch goes from (1) anyone holding the maintainer's publish token, including someone who phished it, running npm publish, to (2) a new patch version that is live within seconds, at any time, with no review, to (3) a version range such as ^4.17.21 that accepts it on the next fresh resolution, to (4) a lockfile change from a bot pull request, npm update, or npm audit fix, to (5) npm ci in CI and deploy. Fixes and malware share steps 1 and 2. The first checkpoint you control is step 4.

A patch release is not a patch applied

#

Lodash shows how far release and adoption drift apart, and how often a security fix needs a fix of its own. Lodash is one of the most widely deployed libraries in the JavaScript ecosystem. In January 2026 it shipped its first security release in nearly five years, the result of Lodash's security reset under a newly funded steering committee.

The npm registry's time map and the GitHub advisories give the sequence:

Date (UTC)ReleaseWhat it fixed
Feb 20, 20214.17.21CVE-2021-23337, command injection in _.template
Jan 21, 20264.17.23CVE-2025-13465, prototype pollution in _.unset and _.omit
Mar 31, 20264.18.0CVE-2026-4800 and CVE-2026-2950, bypasses of the 2021 and January fixes
Apr 1, 20264.18.1A ReferenceError that 4.18.0 introduced in the per-method modules

Two of the three lodash advisories published in 2026 describe bypasses of earlier fixes. The CVE-2026-4800 advisory explains that the 2021 fix validated the variable option of _.template but not the key names in options.imports, which reach the same Function() call. The CVE-2026-2950 advisory says the January fix "only guards against string key members," so array-wrapped path segments slip past it.

The 4.18.0 security release then broke code that loaded lodash/template directly. The fix added calls to arrayEach and assignWith inside _.template. Both are in scope in the single-file lodash.js build. Nobody added them to the per-method module, which lodash generates separately with its build tool. The whole 4.18.1 fix for that file is two require lines:

Diff
--- 4.18.0/package/template.js
+++ 4.18.1/package/template.js
@@ -1,4 +1,6 @@
-var attempt = require('./attempt'),
+var arrayEach = require('./_arrayEach'),
+    assignWith = require('./assignWith'),
+    attempt = require('./attempt'),
     baseValues = require('./_baseValues'),

The lodash 4.18.1 release notes describe the failure plainly: "It's the kind of thing that passes in CI, but fails bc the build is not the same thing you tested."

Adoption lags further still. In npm's per-version download counts for the week before November 7, 2026, lodash 4.18.1 had 134.4 million downloads. 4.17.21 still had 65.7 million, and 4.17.23 had 16.5 million. Versions that npm audit flags as high severity made up more than a third of lodash downloads that week, seven months after the fix shipped. Download counts include CI runs and mirrors, so they overstate the number of projects, but they show where installs actually resolve. Every lockfile nobody regenerates, and every published package that pins lodash exactly, holds its users on an old version.

The figure shows the same release history and download counts. Weekly downloads by version, in millions:

VersionDownloads (millions)npm audit status
4.18.1134.4Not flagged
4.17.2165.7High severity
4.17.2316.5High severity
Older 4.x (4.17.4 to 4.17.20, versions above 200,000 downloads each)5.9High severity
4.18.01.2Not flagged

Verifying a patch therefore takes two checks, not one. First, confirm the new version is what actually runs, by reading the lockfile and the deployed artifact. Then re-read the advisory, because a version that counted as fixed in January can be vulnerable again by March.

How do attackers hide malware in patch releases?

#

Attackers hide malware in patch releases by publishing a new patch-level version from a hijacked maintainer account. Existing version ranges accept it automatically, and nothing about the version number distinguishes it from a fix.

The Qix compromise is the cleanest example. On September 8, 2025, a phishing email from the look-alike domain npmjs.help, posing as a 2FA reset, gave an attacker the npm account of a prolific maintainer. That is a textbook maintainer account takeover. The affected packages generally receive 2 to 3 billion downloads per week combined, according to our report on the attack. The injected code ran in browsers and swapped cryptocurrency wallet addresses in transactions.

We rebuilt the publish sequence from the registry's time map, which keeps timestamps for versions that have since been removed:

Bash
$ npm view chalk time --json | grep '"5\.6'
  "5.6.0": "2025-08-17T07:27:47.572Z",
  "5.6.1": "2025-09-08T13:13:05.239Z",
  "5.6.2": "2025-09-08T14:47:54.486Z",
$ npm view chalk@5.6.1 version
npm error code E404
npm error 404 No match found for version 5.6.1

Repeating that for all 19 packages in our report gives the full sequence. "Previous" is the release immediately before the malicious one.

PackagePreviousMaliciousPublished (UTC)
ansi-styles6.2.16.2.213:12:10
debug4.4.14.4.213:12:39
chalk5.6.05.6.113:13:05
supports-color10.2.010.2.113:13:28
strip-ansi7.1.07.1.113:13:50
ansi-regex6.2.06.2.113:14:15
wrap-ansi9.0.09.0.113:14:36
color-convert3.1.03.1.113:14:53
color-name2.0.02.0.113:15:12
is-arrayish0.3.20.3.313:15:29
slice-ansi7.1.07.1.113:15:47
error-ex1.3.21.3.313:16:05
color-string2.1.02.1.113:18:07
simple-swizzle0.2.20.2.313:19:05
supports-hyperlinks4.1.04.1.113:19:28
has-ansi6.0.06.0.113:19:46
chalk-template1.1.01.1.113:20:09
backslash0.2.00.2.113:20:31
proto-tinker-wc0.1.860.1.8716:51:26

All 19 malicious versions were patch bumps of the release before them. The first 18 went out between 13:12:10 and 13:20:31 UTC. Every one satisfies both a caret (^) and a tilde (~) range written against its predecessor, which we checked with the semver library that ships inside npm. Any fresh resolution of ^5.6.0 while chalk 5.6.1 was live would have selected it, exactly as it would select a bug fix.

The cleanup used the same channel. chalk 5.6.2, the clean replacement, was published at 14:47:54 UTC, 95 minutes after 5.6.1. A policy that accepts 5.6.2 automatically also accepted 5.6.1 automatically. A version number states the publisher's intent about compatibility. It does not say who published the release or what it contains.

Three controls address this, and each has a gap. A committed lockfile installed with npm ci keeps a malicious patch out of existing builds, but not out of fresh resolutions such as npx, new projects, or the bot pull request that bumps the lockfile. A dependency cooldown keeps young versions out of fresh resolutions, and it also delays real security fixes. Analyzing what a package actually contains before install catches the payload itself, which no CVE feed will, but only for traffic that passes through the check.

The cooldown conflict is sharpest for urgent security patches. The Rails team released 8.0.5.2 and 8.1.4.1 on November 4, 2026, fixing 21 vulnerabilities, including the critical Rails Active Storage vulnerability. A 7-day cooldown would hold that release until November 11. The right exception is the exact fixed version, not the package name and not the whole window.

Backporting a fix without upgrading

#

Backporting applies a fix's diff to the version you already run, so the vulnerability closes without any new upstream code. Linux distributions such as Debian work this way. The Debian security FAQ states the rule: "The most important guideline when making a new package that fixes a security problem is to make as few changes as possible."

Language package managers support the same move. pnpm and Yarn have built-in patch commands, and npm projects commonly use the patch-package tool. We backported the upstream _.template fix from lodash 4.18.0 onto 4.17.21 with pnpm 12.18.0. pnpm patch unpacks an editable copy, we applied the 4.18.0 hunk to its lodash.js, and pnpm patch-commit saved the result:

Bash
$ pnpm patch lodash@4.17.21
$ pnpm patch-commit "$(pwd)/node_modules/.pnpm_patches/lodash@4.17.21"

pnpm writes the diff to patches/lodash@4.17.21.patch, registers it under patchedDependencies in pnpm-workspace.yaml, and pins its hash in the lockfile, so every install applies the same bytes. The core of the patch:

Diff
--- a/lodash.js
+++ b/lodash.js
-      options = assignInWith({}, options, settings, customDefaultsAssignIn);
+      options = assignWith({}, options, settings, customDefaultsAssignIn);
 
-      var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
+      var imports = assignWith({}, options.imports, settings.imports, customDefaultsAssignIn),
           importsKeys = keys(imports),
           importsValues = baseValues(imports, importsKeys);
 
+      arrayEach(importsKeys, function(key) {
+        if (reForbiddenIdentifierChars.test(key)) {
+          throw new Error(INVALID_TEMPL_IMPORTS_ERROR_TEXT);
+        }
+      });
+
YAML
patchedDependencies:
  lodash@4.17.21: 2e75f4ce82b006652126797b0bdb49e4eee3751ba65094f4c822fdc50637028d

importers:

  .:
    dependencies:
      lodash:
        specifier: 4.17.21
        version: 4.17.21(patch_hash=2e75f4ce82b006652126797b0bdb49e4eee3751ba65094f4c822fdc50637028d)

The backport has three costs an upgrade does not. Its scope is narrow: it patches lodash.js, which require('lodash') loads, but not the per-method lodash/template module, the same gap that broke 4.18.0, and it leaves CVE-2025-13465 unfixed. It is invisible to scanners: pnpm audit still reports the high-severity _.template advisory, because scanners match version strings, not code. And you now own a fork of one function until you upgrade.

Socket Certified Patches package the same technique with review attached. Each one is a minimal diff for a specific advisory, reviewed by ecosystem maintainers, checked with generated behavioral tests, stored under .socket/ in your repository, and applied during the build, as described in the Certified Patches launch post. Certified Patches for Critical and High severity vulnerabilities are free, including for teams that are not Socket customers, and install by advisory ID, as in socket patch add GHSA-ffh4-j6h5-pg66. They carry the same limits as any backport. The Rails patch covers only the critical Active Storage advisory, not the other 20 vulnerabilities in that release, and our post calls it an interim fix until the upgrade lands.

Building backports also tests the advisories. While preparing the patch for the vm2 sandbox escape, CVE-2026-26956, which is the advisory in that command, we confirmed the exploit on 66 vm2 releases, from 0.2.2 through 3.10.4. The GitHub advisory listed only 3.10.4. A scanner that trusted it would have marked every older install as unaffected.

Choosing a patch intake policy

#

A patch intake policy decides when new versions of your dependencies, fixed or malicious, can enter what you run. These are the common choices for application code:

PolicyWhen a security fix arrivesWhen a malicious patch release arrivesWhat it does not cover
Version ranges, no committed lockfileOn every installOn every installReproducibility; you cannot say what ran
Ranges plus lockfile plus update botWhen the bot pull request mergesWhen the bot pull request mergesFresh resolutions outside the lockfile, such as npx
Exact pins plus lockfile plus update botWhen the bot pull request mergesWhen the bot pull request mergesThe same gap; npm needs --force for out-of-range fixes
Any of the above plus a cooldownAfter the window, or at once with an exact-version exemptionOnly if it stays undetected longer than the windowLong-dormant malware; sources with no publish timestamp, such as Git dependencies
Backport in placeAt once, with no new upstream codeNot through this package, because no new version is installedOther advisories in the same package; scanners still flag the version

Our verdict: commit a lockfile and install with npm ci or --frozen-lockfile everywhere, so no build resolves ranges fresh. Take routine patches through bot pull requests that respect a cooldown, and inspect what each new version contains before merging. Take urgent, reachable fixes at once with an exact-version exemption. Backport instead when the upgrade drags in a large amount of new code or no fixed version fits the dependency tree. Schedule a replacement for every end-of-life dependency, because no intake policy delivers a patch that will never be written. Rails 8.0, for example, reaches the end of its security support on November 7, 2026.

A patch number is a claim, not evidence

#

The third number in a version is a claim the publisher makes about compatibility. It says nothing about who published the release, whether it fixes what its advisory describes, or whether the shipped build matches what was tested. Lodash's 2026 releases missed on the last two and still looked like routine updates. The Qix releases were malicious and looked exactly like routine updates. Patch management for dependencies is the work of checking those claims before the lockfile changes. The open problem is scale: AI-assisted discovery is raising disclosure rates, and the number of claims to check is growing faster than the number of people checking them.