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

Re-enable npm audit CI job #6690

Merged
merged 15 commits into from
Jun 6, 2019
Merged

Re-enable npm audit CI job #6690

merged 15 commits into from
Jun 6, 2019

Conversation

whymarrh
Copy link
Contributor

@whymarrh whymarrh commented Jun 6, 2019

Fixes #6684, closes #6686

This PR re-enables our test-deps CI job which runs npm audit against our dependencies. Through trial and error I've been able to adjust our package-lock.json file to produce successful npm audit runs AND I've updated our test-deps job to only fail on "high" or "moderate" severity advisories in our production dependencies.

The situation on develop

Currently on develop (as of v6.6.0), npm produces the following error when running npm audit:

$ npm audit
npm ERR! code ENOAUDIT
npm ERR! audit Your configured registry (https://registry.npmjs.org/) does not support audit requests.

npm ERR! A complete log of this run can be found in:
npm ERR!     ~/.npm/_logs/2019-06-06T16_09_53_348Z-debug.log

I don't know why we get that error or what it means. I believe it to be a bug in npm. I reached out to npm support back when we had originally disabled this part of our test suite and I received the following response:

Thanks for the log, @whymarrh. This looks to be a bug and I've alerted our team about it.

In terms of a workaround, if possible, we recommend upgrading to the latest version of npm and the latest version of Node as well.

We've written a ticket internally for this issue to be worked on. Unfortunately, I can't speak to specific timelines (which are determined by our Product staff) but wanted to let you know it's on our radar.

Best wishes,
CJ

Support Engineer
npm, Inc.

Getting a successful audit run

Trial and error has produced a successful npm audit run. I methodically poked at our dependencies, uninstalling packages and re-installing them, until I could get a full run (e.g. 95be7d5) and inspecting the resulting package-lock.json file changes along the way.

On this branch:

                       === npm audit security report ===                        
                                                                                
# Run  npm update fstream --depth 7  to resolve 2 vulnerabilities
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ High          │ Arbitrary File Overwrite                                     │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ fstream                                                      │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ ganache-core [dev]                                           │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ ganache-core > web3 > web3-bzz > swarm-js > tar.gz > fstream │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://nodesecurity.io/advisories/886                       │
└───────────────┴──────────────────────────────────────────────────────────────┘


┌───────────────┬──────────────────────────────────────────────────────────────┐
│ High          │ Arbitrary File Overwrite                                     │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ fstream                                                      │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ ganache-core [dev]                                           │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ ganache-core > web3 > web3-bzz > swarm-js > tar.gz > tar >   │
│               │ fstream                                                      │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://nodesecurity.io/advisories/886                       │
└───────────────┴──────────────────────────────────────────────────────────────┘


# Run  npm update tar --depth 6  to resolve 1 vulnerability
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ High          │ Arbitrary File Overwrite                                     │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ tar                                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ ganache-core [dev]                                           │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ ganache-core > web3 > web3-bzz > swarm-js > tar.gz > tar     │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://nodesecurity.io/advisories/803                       │
└───────────────┴──────────────────────────────────────────────────────────────┘


┌──────────────────────────────────────────────────────────────────────────────┐
│                                Manual Review                                 │
│            Some vulnerabilities require your attention to resolve            │
│                                                                              │
│         Visit https://go.npm.me/audit-guide for additional guidance          │
└──────────────────────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Low           │ Insecure Credential Storage                                  │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ web3                                                         │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ No patch available                                           │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ abi-decoder                                                  │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ abi-decoder > web3                                           │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://nodesecurity.io/advisories/877                       │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Low           │ Insecure Credential Storage                                  │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ web3                                                         │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ No patch available                                           │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ gaba                                                         │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ gaba > web3                                                  │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://nodesecurity.io/advisories/877                       │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Low           │ Insecure Credential Storage                                  │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ web3                                                         │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ No patch available                                           │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ web3                                                         │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ web3                                                         │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://nodesecurity.io/advisories/877                       │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Low           │ Regular Expression Denial of Service                         │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ braces                                                       │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=2.3.1                                                      │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ gulp-stylefmt [dev]                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ gulp-stylefmt > stylefmt > stylelint > micromatch > braces   │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://nodesecurity.io/advisories/786                       │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Low           │ Regular Expression Denial of Service                         │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ braces                                                       │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=2.3.1                                                      │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ gulp-stylefmt [dev]                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ gulp-stylefmt > stylefmt > stylelint-order > stylelint >     │
│               │ micromatch > braces                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://nodesecurity.io/advisories/786                       │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Low           │ Regular Expression Denial of Service                         │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ braces                                                       │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=2.3.1                                                      │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ gulp-watch [dev]                                             │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ gulp-watch > anymatch > micromatch > braces                  │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://nodesecurity.io/advisories/786                       │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Low           │ Regular Expression Denial of Service                         │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ braces                                                       │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=2.3.1                                                      │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ qunitjs [dev]                                                │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ qunitjs > chokidar > anymatch > micromatch > braces          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://nodesecurity.io/advisories/786                       │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Low           │ Regular Expression Denial of Service                         │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ braces                                                       │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=2.3.1                                                      │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ qunitjs [dev]                                                │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ qunitjs > findup-sync > micromatch > braces                  │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://nodesecurity.io/advisories/786                       │
└───────────────┴──────────────────────────────────────────────────────────────┘
found 11 vulnerabilities (8 low, 3 high) in 255418 scanned packages
  run `npm audit fix` to fix 3 of them.
  8 vulnerabilities require manual review. See the full report for details.

Breaking changes

To get here, we've made the following breaking changes to some of our dev dependencies:

  • @storybook/addon-info, @storybook/react, and css-loader (13feeb2)
  • karma@^3.1.1 to karma@^4.1.0 (1ad52a8)

@whymarrh whymarrh changed the title Re-enable npm audit test dependency Re-enable npm audit CI job Jun 6, 2019
@metamaskbot
Copy link
Collaborator

Builds ready [ea142a4]: chrome, firefox, edge, opera

@tmashuang tmashuang merged commit 3dc7e29 into develop Jun 6, 2019
@tmashuang tmashuang deleted the npm-audit branch June 6, 2019 22:00
@danfinlay danfinlay mentioned this pull request Jun 10, 2019
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

Successfully merging this pull request may close these issues.

security: re-enable NPM audit
3 participants