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

[Snyk: Med] Prototype Pollution (Due 07/05/2020) #4337

Closed
1 of 2 tasks
fec-jli opened this issue May 6, 2020 · 9 comments
Closed
1 of 2 tasks

[Snyk: Med] Prototype Pollution (Due 07/05/2020) #4337

fec-jli opened this issue May 6, 2020 · 9 comments
Assignees
Labels
Security: moderate Remediate within 60 days

Comments

@fec-jli
Copy link
Contributor

fec-jli commented May 6, 2020

Summary

Medium severity vulnerability found
Description: Prototype Pollution
Info: https://app.snyk.io/vuln/SNYK-JS-LODASH-567746
Prototype Pollution is a vulnerability affecting JavaScript.

Remediation: There is no fixed version for lodash.

Completion criteria:

  • Check to see if there's a remediation path for this
  • Consider/document alternatives or workaround to solve this security issue and do that thing
@pkfec
Copy link
Contributor

pkfec commented Jun 3, 2020

  1. Tried updating lodash to v4.17.15 in package.json
  2. deleted the package-lock.json from local : rm - rf package-lock.json
  3. deleted the node_modules from local : rm - rf node_modules/
  4. installed npm pkgs again : npm i and npm run build
  5. from CLI ran : synk test
  6. proto type pollution vulnerability still exists on openFEC repo.

The latest version of lodash pkg still do not have the patch/remediation for Prototype Pollution yet. At this point there is nothing i can do and wait for the PATCH to be released here (https://app.snyk.io/vuln/SNYK-JS-LODASH-567746)

@pkfec
Copy link
Contributor

pkfec commented Jun 12, 2020

Patch yet to be release for Lodash v4.17.15. Until then moving this ticket to blocked section.

@rfultz
Copy link
Contributor

rfultz commented Jun 26, 2020

@pkfec looking through the repo, things are going to be complicated.

  • It doesn't look like our code is using lodash at all—no references to lodash anywhere in code that we wrote or maintain. We have it listed as a dev dependency but I suspect that's only to dictate a minimum version for other dependencies.
  • I can't find any reference to .objectDeep so maybe we're at lower risk
  • However, several other packages are using lodash, and those packages may all need updates, depending on how lodash implements the fix (with their PR #4759).
  • Packages involved (who may all need to update), npm ls lodash:
    • babel-core
      • babel-generator
      • babel-register
      • babel-template
      • babel-traverse
      • babel-types
    • babel-preset-env
      • babel-plugin-transform-es2015-block-scoping
      • babel-plugin-transform-es2015-classes
        • babel-helper-define-map
      • babel-plugin-transform-es2015-sticky-regex
        • babel-helper-regex
    • css-loader
    • eslint
      • inquirer
      • table
    • extract-text-webpack-plugin
      • async
    • swagger-tools
      • json-refs
        • graphlib
    • webpack-dev-server
      • http-proxy-middleware
  • I wonder if moving these ☝️ to devDependencies would break anything, and maybe lower our risk

@rfultz
Copy link
Contributor

rfultz commented Jun 26, 2020

Should we mark this as a dupe of #3740 ?

@lbeaufort
Copy link
Member

It looks like a fix was made but a release still needs to be pushed: https://github.com/lodash/lodash/issues/4837

@pkfec
Copy link
Contributor

pkfec commented Jul 6, 2020

Notified security team that this issue is BLOCKED until the LODASH package is fixed in a later version.
See here: https://app.snyk.io/vuln/SNYK-JS-LODASH-567746

@lbeaufort
Copy link
Member

Looks like a fix is ready: https://github.com/lodash/lodash/issues/4837#issuecomment-655648024

@pkfec
Copy link
Contributor

pkfec commented Jul 9, 2020

Lodash v4.17.19 is released just 13 hours ago. I am going to upgrade to this new version and test the openFEC repo. And a PR will be soon ready for review.

@pkfec pkfec mentioned this issue Jul 9, 2020
@pkfec
Copy link
Contributor

pkfec commented Jul 9, 2020

It seems @lbeaufort audited the npm pkg yesterday and upgraded lodash package already to 4.17.17 on openFEC/develop.
see here for code changes : https://github.com/fecgov/openFEC/blob/develop/package.json#L43.

I ran the CLI command snyk test on openFEC/develop branch, Prototype Pollution snyk vulnerability is resolved already.

No code changes are needed. Closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Security: moderate Remediate within 60 days
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants