-
Notifications
You must be signed in to change notification settings - Fork 27
Update dependencies & add Snyk #60
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
Conversation
This reverts commit 3ea03ff.
Reported from Snyk, uses 2.0.1 which was updated a year ago.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When running npx snyk test I'm receiving a third failure on develop that persists on this branch.
I'm also receiving an error during buildSass on the following fulp tasks
compilecompileSassupdateUswds// runscompilementioned above
Error: Cannot find module '../../uswds/package.json'
If I update the path to package.json I'm able to resolve it
- const pkg = require(`../../${uswdsPath}/package.json`).version;
+ const pkg = require(`../${uswdsPath}/package.json`).version; Curious why I've received this error if you haven't!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mejiaj This is looking good, but I had trouble removing the vulnerabilities when I installed this branch on uswds-site (notes below). It looks like you ran into a similar issue as described in your PR description. I am not sure if that is an issue with the install method or with the overrides themselves, just wanted to flag it.
- Successfully completed all steps to confirm vulnerabilities in
develop - Successfully completed all steps to confirm 0 vulnerabilities and no snyk errors in this branch
- Confirmed that all gulp tasks work when installed on a local uswds and uswds-compile project
- Confirmed dependencies are now on their latest version (with the exception of
del) - Confirmed dependency table in the PR description matches updated dependencies
- Confirmed this branch removes
unset-valueandglob-parentsnyk errors in uswds-site- When I install the
jm-update-dependenciesbranch in uswds-site, via bothnpm linkand installing the remote branch, it shows6 high severity vulnerabilitiesand does not resolveglob-parentorunset-valuesnyk errors. I confirmed that @uswds/compile had the overrides in itspackage.json.
- When I install the
This is after removing How I testeduswds-compile on jm-update-dependencies via v18.15.0 via 💎 v2.7.2
➜ rm -rf node_modules package-lock.json
npm %
uswds-compile on jm-update-dependencies [✘] via v18.15.0 via 💎 v2.7.2
➜ npm i
npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated [email protected]: The v1 package contains DANGEROUS / INSECURE binaries. Upgrade to safe fsevents v2
npm WARN deprecated [email protected]: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
added 512 packages, and audited 513 packages in 13s
45 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
uswds-compile on jm-update-dependencies [!1] via v18.15.0 via 💎 v2.7.2 took 13s
➜ npx snyk test
Testing /Users/jmejia-a/web/uswds-compile...
Organization: uswds
Package manager: npm
Target file: package-lock.json
Project name: @uswds/compile
Open source: no
Project path: /Users/jmejia-a/web/uswds-compile
Licenses: enabled
✔ Tested 415 dependencies for known issues, no vulnerable paths found.
Next steps:
- Run `snyk monitor` to be notified about new related vulnerabilities.
- Run `snyk test` as part of your CI/test.
You need a test project to run the Compile tasks. I've updated notes to point to uswds/uswds-sandbox at test-compile-60. Thanks for pointing that out. |
Pin del to 6.1.1 Co-authored-by: Amy Leadem <[email protected]>
@amyleadem I was able to reproduce the last note and not sure why that's happening. It might be an issue with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mejiaj I was able to run the gulp commands on the test repo linked in the description but I still received the npx snyk test failure after removing node_modules and package-lock.json
Terminal results
uswds-compile on jm-update-dependencies [!] is 📦 v1.0.0 via v16.19.0 via 💎 v2.6.10
❯ rm -rf node_modules package-lock.json
uswds-compile on jm-update-dependencies [✘!] is 📦 v1.0.0 via v16.19.0 via 💎 v2.6.10
❯ npm i
npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated [email protected]: The v1 package contains DANGEROUS / INSECURE binaries. Upgrade to safe fsevents v2
npm WARN deprecated [email protected]: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
added 513 packages, and audited 514 packages in 23s
46 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
uswds-compile on jm-update-dependencies [!] is 📦 v1.0.0 via v16.19.0 via 💎 v2.6.10 took 23s
❯ npx snyk test
Testing /Users/cmahoney/web/uswds-compile...
Tested 420 dependencies for known issues, found 1 issue, 5 vulnerable paths.
Issues with no direct upgrade or patch:
✗ Regular Expression Denial of Service (ReDoS) [High Severity][https://security.snyk.io/vuln/SNYK-JS-ANSIREGEX-1583908] in [email protected]
introduced by [email protected] > [email protected] > [email protected] > [email protected] > [email protected] > [email protected] and 4 other path(s)
This issue was fixed in versions: 3.0.1, 4.1.1, 5.0.1, 6.0.1
Organization: mahoneycm-gsa
Package manager: npm
Target file: package-lock.json
Project name: @uswds/compile
Open source: no
Project path: /Users/cmahoney/web/uswds-compile
Licenses: enabled|
@mahoneycm can you do a clean install and test again? |
|
@mejiaj same issue as before: |
|
@mahoneycm thanks for that info!
Source: NPMJS on I wasn't able to reproduce this issue via |
|
I've updated dependencies and run And now we're back to zero vulnerabilities. # 07/12/23 - After `npm audit fix`.
uswds-compile on jm-update-dependencies [+] via NPM v18.15.0
→ npm audit fix
changed 2 packages, and audited 513 packages in 478ms
39 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities |
|
As of 09/07/23 there are still 0 vulnerabilities. This is ready for review & merge @thisisdano. Moving additional dep updates to a new issue #71. |
|
FWIW -- I downgraded to node |
|
@jeremyzilar could you try node 20? That's the latest LTS version. |
This PR:
overridesCloses #48.
Dependency updates
@uswds/uswdsuswdsautoprefixerdelglob-parent[gulp-replacepostcsssass-embeddedunset-value[How to test
Confirm errors
git checkout developbranchnpm i && npm audit6 high severity vulnerabilitiesnpx snyk testfound 2 issues, 33 vulnerable paths.git checkout -- .Confirm fix
git checkout jm-update-dependenciesnpm i && npm auditnpx snyk testTest functionality:
test-compile-60or use site.npm audit.