Skip to content

(FR): Implement exclusion mechanism for 'minimumReleaseAge' feature for CVE mitigation #895

Closed

Description

@dburrows

minimumReleaseAge was recently implemented which is a great addition to combat supply chain attacks, unfortunately not having an exclusion mechanism makes adoption hard.

In the situation where there's an urgent CVE that needs mitigation by immediately updating an affected package there's no way to allow that particular package to be excluded from the minimum release age.

As prior art, pnpm have already implemented a mechanism https://pnpm.io/settings#minimumreleaseageexclude so might be a good idea to align with that.

As ever, thanks for all the hard work!

Activity

  1. daiscog commented on Feb 23, 2026

    @daiscog

    Additional use case: Organizations will often want to be able to consume their own packages immediately and only apply minimum release age to third party packages, so would want to exclude @my-org/* (for example) from the config.

  2. janikarki commented on Mar 31, 2026

    @janikarki

    In the Python world, uv allows overriding the minimum release age requirement for specific packages on a one-off basis, avoiding the need to put the exemption in a config file where it may be forgotten way beyond its welcome.

    For example:

    uv lock --upgrade --exclude-newer-package "cryptography=0s"

    In this case, cryptography would update to the latest version, no matter how recent, while the general minimum release age requirement would still apply to all other depdencencies.

  3. fritz-c commented on Mar 31, 2026

    @fritz-c

    As daiscog said, the exclude rule is useful for allowing your internal packages to be updated without limitation. However, I would also propose an additional behavior that's kind of in line with what janikarki said - if a newer version has been explicitly installed, it should also be exempt from the minimum age restriction. In other words, if a package has the following versions:

    my-package@1.0.0 - 5 days old
    my-package@1.0.1 - 2 days old
    my-package@1.0.2 - 1 day old
    

    and my .npmrc has minimum-release-age=3,
    a dependency of my-package@^1.0.0 in my package.json would install 1.0.0, but
    a dependency of my-package@^1.0.1 would install 1.0.1, even though it's newer than my 3-day minimum.

    This behavior would be nice because adding a minimumReleaseAgeExclude entry for my-package would work for a one-off update to mitigate CVEs, but you have to remember to remove that entry at some point in the future, or else you're essentially trusting that package to never have any zero-day issues in the future.

  4. niemyjski commented on May 12, 2026

    @niemyjski

    This is needed like yesterday, what can the community do here? can we finalize a solution so we can work on a pr?

  5. karlhorky commented on May 13, 2026

    @karlhorky

    @niemyjski Looking at the PR links directly above your comment, it looks like @caseyjhol created a PR in Mar 2026 which could address this:

    @wraithgar answered in comment 4253575699 that it overlaps with dependency types and lifecycle support:

    This is a feature that overlaps with several other things folks want, including allowing dependency types and allowing lifecycle scripts. Because of that we have an rfc discussion ongoing in npm/rfcs#861 to try to come up with something that will work as a pattern for all of these approaches. We don't want to throw quick solutions at this which are hard to maintain or implement.

    So looks like this feature will be in the design phase after #861 is hashed out further.


    Possible API direction: One of the last sketches for the #861 API proposal from @everett1992 includes an override for min-release-age (second example mine):

    {
      // Use latest release of @scope packages.
      "[name^='@scope/']": { "min-release-age": 0 },
    
      // Bypass min-release-age for next@16.2.6
      "#next@16.2.6": { "min-release-age": 0 },
    }

    Source: #861 (comment)

  6. v-mragunandhan24 commented on Jun 9, 2026

    @v-mragunandhan24

    @dburrows Thanks for taking the time to share your idea! New ideas are always appreciated and are better suited for our RFC repo instead since that's the right place in order to get more attention from the rest of the team and the community.

    I've transferred the issue to that repo for future discussion

  7. transferred this issue fromnpm/clion Jun 9, 2026
  8. owlstronaut commented on Jun 10, 2026

    @owlstronaut

    merged!

  9. added a commit that references this issue on Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions