Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RRFC] Warn users when skipping alias/git deps during audit #497

Open
rotem-cider opened this issue Nov 11, 2021 · 3 comments
Open

[RRFC] Warn users when skipping alias/git deps during audit #497

rotem-cider opened this issue Nov 11, 2021 · 3 comments

Comments

@rotem-cider
Copy link

The problem

When running "NPM audit" with alias packages, or packages received from git installation,
it simply skips the package with no warning or sign that the package was not validated.

Organizations relying on the npm audit functionality as part of their installation can be fooled into downloading malwared / vulnerable packages.

Sample vulnerable package "pug => 3.0.0" can be bypassed when used with an alias "pug => npm:pug@3.0.0"
Same bypass can happen also when using from tarball

dependencies": {
    "pug": "https://github.com/pugjs/pug/tarball/pug@3.0.0"
  }

Steps to reproduce

  1. npm init
  2. npm i --save pug@npm:pug@3.0.0
  3. npm audit

Possible Remediation

In npm 7 package aliases are checked but still not with "out-of-store" packages,
Currently because of the issue here - npm/cli#2701 it is not possible to upgrade to npm 7 in CI environments

There is no warning of packages that are not scanned in UI or in the outcoming JSON which I think should have some kind of warning/error

This issue was disclosed to the security team in March and it was decided that this should be filed as a feature/issue and not a security bug.

@darcyclarke darcyclarke changed the title NPM Audit 6 security bypass [RRFC] Warn users when skipping alias/git deps during audit Dec 1, 2021
@darcyclarke
Copy link
Contributor

darcyclarke commented Dec 1, 2021

@rotem-cider Thanks for filing this! Since this is working as intended, I've transferred this issue to our RFC repo where we can further discuss the design/direction/implementation. I also updated the title of the issue (prev. NPM Audit 6 security bypass to Warn users when skipping alias/git deps during audit) but feel free to change it back if you want (thought the latter might provided a bit more context out-the-gate)

@darcyclarke darcyclarke transferred this issue from npm/cli Dec 1, 2021
@ljharb
Copy link
Contributor

ljharb commented Dec 1, 2021

It seems like alias deps should not be skipped at all, but skipping git deps is a behavior i'd expect.

@rotem-cider
Copy link
Author

Great, Thanks @darcyclarke

I’ll be happy to participate in future rfc talks to help improve the ecosystem

@darcyclarke darcyclarke added the Agenda will be discussed at the Open RFC call label Dec 15, 2021
@darcyclarke darcyclarke removed the Agenda will be discussed at the Open RFC call label Jan 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants