Search code examples
lodash

Lodash vulnerability in Angular project


After installing npm to the blur-admin template https://github.com/akveo/blur-admin

I had a number of issues which I fixed by using the run recomendations in the npm audit dialog. However I cant fix one even after running

$ npm install lodash@latest --save

I have updated the lodash file in package.json:

{
  "name": "blur_admin",
  "version": "1.3.1",
  "devDependencies": {
    "bower": "~1.8.4",
    "browser-sync": "^2.26.3",
    "browser-sync-spa": "~1.0.3",
    "chalk": "~1.1.1",
    "del": "~2.2.2",
    "eslint-plugin-angular": "~0.12.0",
    "estraverse": "~4.2.0",
    "gulp": "^4.0.0",
    "gulp-angular-filesort": "^1.2.1",
    "gulp-angular-templatecache": "~2.0.0",
    "gulp-autoprefixer": "~3.1.1",
    "gulp-eslint": "^5.0.0",
    "gulp-filter": "~4.0.0",
    "gulp-flatten": "~0.3.1",
    "gulp-gh-pages": "^0.5.4",
    "gulp-inject": "~4.1.0",
    "gulp-load-plugins": "~1.4.0",
    "gulp-minify-css": "~1.2.1",
    "gulp-minify-html": "~1.0.4",
    "gulp-ng-annotate": "~2.0.0",
    "gulp-prompt": "^1.1.0",
    "gulp-protractor": "^4.1.0",
    "gulp-rename": "^1.2.2",
    "gulp-replace": "~0.5.4",
    "gulp-rev": "~7.1.2",
    "gulp-rev-replace": "~0.4.2",
    "gulp-sass": "^4.0.1",
    "gulp-shell": "^0.5.2",
    "gulp-size": "~2.1.0",
    "gulp-sourcemaps": "~1.6.0",
    "gulp-uglify": "~2.0.0",
    "gulp-useref": "^3.1.6",
    "gulp-util": "~3.0.6",
    "gulp-zip": "^3.0.2",
    "http-proxy-middleware": "~0.17.2",
    "lodash": "^4.17.11",
    "main-bower-files": "~2.13.1",
    "uglify-save-license": "~0.4.1",
    "wiredep": "~4.0.0",
    "wrench": "~1.5.8"
  },
  "scripts": {
    "postinstall": "bower install"
  }
}

But still get: PS D:\dev\Blur-Admin test\blur-admin-master\blur-admin-master> npm audit

                       === npm audit security report ===


                                 Manual Review
             Some vulnerabilities require your attention to resolve

          Visit https://go.npm.me/audit-guide for additional guidance


  Low             Prototype Pollution

  Package         lodash

  Patched in      >=4.17.5

  Dependency of   browser-sync-spa [dev]

  Path            browser-sync-spa > opt-merger > lodash

  More info       https://nodesecurity.io/advisories/577

found 1 low severity vulnerability in 13272 scanned packages
  1 vulnerability requires manual review. See the full report for details.
PS D:\dev\Blur-Admin test\blur-admin-master\blur-admin-master>

I've tried everything!


Solution

  • This usually means that one of the other project dependencies in your project.json has a dependency of lodash and they have not patched their pacakge.json.

    The error states which one it is: "browser-sync-spa" and the path to it:

    browser-sync-spa > opt-merger > lodash
    

    You would have to open an issue on browser-sync-spa or opt-merger to update their repo/package.json or open a PR for them.

    Other option is to live with it or Fork their project which is the nuclear option.