tornaia / karma-sonarqube-unit-reporter

A Karma plugin. Unit tests execution report for SonarQube/Generic Coverage Plugin
MIT License
33 stars 28 forks source link

Yarn audit (possibly npm audit) reports a vulnerability. #36

Open Kiran-B opened 5 years ago

Kiran-B commented 5 years ago

I have a project in which karma-sonarqube-unit-reporter is a dev dependency. When executing the command yarn audit it reports a vulnerability due to this package. I believe this would also be the case if you use npm audit.

Below is the audit report:

❯ yarn audit 
yarn audit v1.13.0
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ low           │ Prototype Pollution                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ lodash                                                       │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=4.17.5                                                     │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ karma-sonarqube-unit-reporter                                │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ karma-sonarqube-unit-reporter > xmlbuilder > lodash          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://nodesecurity.io/advisories/577                       │
└───────────────┴──────────────────────────────────────────────────────────────┘
1 vulnerabilities found - Packages audited: 43979
Severity: 1 Low

Steps to regenerate:

  1. Add karma-sonarqube-unit-reporter as a dev dependency to a node based project. In my case it is an Angular 7.x project.
    ng new testproj
    yarn add --dev karma-sonarqube-unit-reporter
  2. Execute yarn audit

Possible fix:

Upgrade xmlbuilder dependency from 3.1.0 to at least 4.2.1.

tztz commented 5 years ago

This is also fixed in https://github.com/tornaia/karma-sonarqube-unit-reporter/pull/39