Skip to content

npm min-release-age: when a security patch needs an exception

7 min read
Operations
npm min-release-age: when a security patch needs an exception

Key Takeaways

  • 1Keep release-age policy for routine updates and record why an urgent fix needs an exception
  • 2Limit an exception to the affected package and remove it after the approved update
  • 3Review every lockfile change and test the exact commit that will reach production
  • 4Close the record with deployment evidence, restored policy and a named owner

Your dependency update can leave a known vulnerability in place even when a patched release exists: npm's current release-age documentation says a blocked npm audit fix retains the vulnerable version, warns and exits unsuccessfully. The technology lead must decide whether to wait or authorise an exception.

For an internal JavaScript tool, make that decision against the application's exposure and the proposed package change. Keep the normal policy for routine updates. When waiting creates unacceptable risk, approve a specific update with evidence, an owner and an end to the exception. The workflow below is a recommended operating model; its example waiting period is illustrative.

Understand what npm min-release-age decides

According to npm's configuration reference, the setting filters versions by age in days; its default is unset. If no eligible version satisfies the dependencies, installation errors. An age threshold therefore controls version selection. It does not establish that an eligible release is safe.

Write down what your team expects the delay to achieve. For example, you might want time to inspect a new release before adopting it. That is a local policy choice, with a cost when an urgent repair arrives. Avoid presenting the chosen interval as a security standard or a promise that harmful packages will be discovered during it.

Before approving anything, retain the failing command, relevant warning, advisory reference, current package version and intended replacement. Check that release age actually caused the block. A dependency conflict or failed application test needs a different correction. Ask the engineer to show the relevant output rather than accepting “npm is blocking us” as the diagnosis.

Decide whether waiting is acceptable

Have the application owner explain where the affected dependency runs and what input reaches it. A package used by an exposed request handler deserves a different assessment from a tool used only in a restricted development task. Document the reasoning; an advisory severity label alone does not describe your deployment.

Use this decision table as a review aid, with local incident procedures taking priority.

Situation Recommended decision Evidence to retain
Routine update with no urgent exposure identified Keep the waiting policy Update ticket and planned review
Relevant vulnerability, with an effective temporary restriction Consider waiting with a review deadline Restriction, owner and exposure assessment
Waiting leaves unacceptable exposure and a reviewed patch is available Approve a narrow, temporary exception Advisory, target version and accepted test plan
Package origin or proposed changes cannot be explained Pause adoption and contain exposure Unresolved questions and containment owner

If you suspect compromise, start incident response rather than treating the problem as an ordinary update approval. Restrict the affected function when necessary while the responsible team investigates. Conversely, do not waive the delay simply because a dependency bot has opened an inconvenient pull request. Record what changes the risk of waiting.

Make the exception narrow and temporary

The npm exclusion setting accepts package names or patterns. A named exclusion covers that package, while its dependencies remain subject to the filter unless separately matched. It also exempts the package from before, npm's absolute-date filter. Review that setting too if your project uses it.

Prefer an exact package name over a broad scope pattern. Agree the target version separately: a name-based exception should not become permission to adopt any future release. Put the approved package, version, advisory, approver and removal condition in the update ticket before the engineer changes the update process.

Consider a hypothetical purchasing tool whose team has chosen a three-day delay. A fictional parser dependency receives an urgent patch before that delay expires. The owner confirms that supplier uploads reach the affected parser and that disabling uploads would interrupt necessary work. The approver permits the reviewed replacement for that parser, with an exception confined to the controlled update job.

The engineer must still explain any changed dependencies. If a required dependency is also blocked, return it for review rather than widening the exclusion silently. After producing the approved update, remove the temporary setting and retain the configuration change as evidence. The example's three days describe this team's choice, not npm advice or a recommended minimum.

Review the lockfile before approving the release

npm documents that npm audit fix runs an installation internally, so installer configuration applies. Some vulnerabilities require manual intervention. Treat the command's result as a proposed change requiring review.

Ask the reviewer to compare the previous and proposed lockfiles. Check the affected package's resolved version, the source it will be downloaded from, and every additional package change. Require an explanation for unrelated movement. If the update changes more than the approval covered, revise the proposal before merging it.

For the fictional purchasing tool, acceptance should include a harmless supplier upload that exercises the parser, expected rejection of malformed input, and a check that a normal purchase can still be completed. Choose tests around the actual application function and advisory. A successful install provides no evidence that the purchasing workflow still works.

Attach the reviewed commit reference, lockfile diff, test results and remaining findings to the ticket. Keep the previous deployable application release available and describe who can restore it. If rollback would reintroduce the vulnerable dependency, agree the accompanying containment action before deployment. Restoring service and accepting renewed exposure require an explicit decision.

Prove the approved commit works in CI

According to the npm ci documentation, CI installation requires an existing lockfile, fails when it disagrees with package.json, and does not rewrite either file. Tree-shaping options used to create the lockfile must also be supplied where required.

Run the reviewed commit through a clean CI job with the agreed Node and npm versions and the intended configuration. Retain those versions, the commit reference, installation result and application test results. Confirm that the version actually installed matches the approved replacement.

Do not assume that removing an exclusion proves an already locked dependency has passed an age check. Verify the behaviour of your chosen toolchain and distinguish installation evidence from the policy decision that admitted the version. This article does not establish behaviour for every npm release, registry proxy or existing lockfile.

Review the job's diagnostic output before attaching it to an ordinary ticket. Our guide to GitHub Actions log secret scanning covers ownership of a separate detection control. For this change, keep useful version and test evidence without copying credentials into the approval record.

Close the exception with deployment evidence

Use this checklist before closing the update:

  • The approver accepted the documented reason for bypassing the delay.
  • The reviewed lockfile contains the intended replacement and explained dependency changes.
  • Clean CI installation and relevant application tests passed for the approved commit.
  • The release owner confirmed which application version reached the target environment.
  • The temporary exclusion was removed, and the normal configuration was reviewed.
  • Remaining findings, containment actions and rollback responsibilities have owners.

A short exception record lets the next engineer see why the policy was bypassed and whether that permission still applies. Keep the waiting rule for ordinary updates, and require evidence whenever urgency overrides it. This week, rehearse the record on an existing dependency update, then connect its approval and rollback steps to your monthly patch routine.

Sources

Current npm CLI documentation checked on 17 November 2026; recommendations and the purchasing-tool example are proposed here.

Share this article

Interested in Custom Software & Systems?

Learn more about how we can help your organization with this service.

Explore Service

Need expert guidance?

Let's discuss how our experience can help solve your biggest challenges.