Skip to content

[rush] npm-check version in rush-lib is vulnerable  #5328

@cmalonzo

Description

@cmalonzo

Summary

rush-lib depends on a package with vulnerabilities: npm-check (here in package.json)

Repro steps

  1. Run npm audit from a project that depends on @microsoft/rush-lib (say @microsoft/generator-sharepoint)
  2. See following reports and tracking down the dependency tree, these are coming from @microsoft/rush-lib
got  <11.8.5
Severity: moderate
Got allows a redirect to a UNIX socket - https://github.com/advisories/GHSA-pfrx-2q88-qq97
fix available via `npm audit fix --force`
Will install @microsoft/spfx-web-build-rig@1.13.1, which is a breaking change
node_modules/got
  package-json  <=6.5.0
  Depends on vulnerable versions of got
  node_modules/package-json
    latest-version  0.2.0 - 5.1.0
    Depends on vulnerable versions of package-json
    node_modules/latest-version
      update-notifier  0.2.0 - 5.1.0
      Depends on vulnerable versions of latest-version
      node_modules/update-notifier
        npm-check  >=3.2.7
        Depends on vulnerable versions of inquirer
        Depends on vulnerable versions of package-json
        Depends on vulnerable versions of update-notifier
        node_modules/npm-check
          @microsoft/rush-lib  >=5.4.0
          Depends on vulnerable versions of inquirer
          Depends on vulnerable versions of npm-check
          node_modules/@microsoft/rush-lib

Expected result: npm audit does not return above report.

Actual result: Returns above vulnerability.

Details

Solve by:
Bump npm-check version to below 3.2.7 or use an alternative like taze

Bug to address update-notifier vulnerability: dylang/npm-check#464

Standard questions

Please answer these questions to help us investigate your issue more quickly:

Question Answer
Package name: @microsoft/rush-lib
Package version? 5.158.0
Operating system? Mac
Would you consider contributing a PR?
Node.js version (node -v)? v18.20.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort: easyProbably a quick fix. Want to contribute? :-)help wantedIf you're looking to contribute, this issue is a good place to start!

    Type

    No type

    Projects

    Status

    Needs Investigation

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions