algorithm-archive icon indicating copy to clipboard operation
algorithm-archive copied to clipboard

node module vulnerabilities

Open henrikac opened this issue 3 years ago • 6 comments

Installing node modules with npm install gives the following output:

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

added 421 packages from 433 contributors and audited 422 packages in 11.623s

19 packages are looking for funding
  run `npm fund` for details

found 16 vulnerabilities (7 moderate, 9 high)
  run `npm audit fix` to fix them, or `npm audit` for details

and npm audit gives the following output:

                       === npm audit security report ===                        
                                                                                
# Run  npm update lodash --depth 5  to resolve 6 vulnerabilities
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ High          │ Command Injection in lodash                                  │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ lodash                                                       │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ honkit                                                       │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ honkit > @honkit/asciidoc > lodash                           │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://github.com/advisories/GHSA-35jh-r3h4-6jhm            │
└───────────────┴──────────────────────────────────────────────────────────────┘


┌───────────────┬──────────────────────────────────────────────────────────────┐
│ High          │ Command Injection in lodash                                  │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ lodash                                                       │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ honkit                                                       │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ honkit > @honkit/asciidoc > @honkit/html > lodash            │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://github.com/advisories/GHSA-35jh-r3h4-6jhm            │
└───────────────┴──────────────────────────────────────────────────────────────┘


┌───────────────┬──────────────────────────────────────────────────────────────┐
│ High          │ Command Injection in lodash                                  │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ lodash                                                       │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ honkit                                                       │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ honkit > @honkit/asciidoc > @honkit/html > cheerio > lodash  │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://github.com/advisories/GHSA-35jh-r3h4-6jhm            │
└───────────────┴──────────────────────────────────────────────────────────────┘


┌───────────────┬──────────────────────────────────────────────────────────────┐
│ High          │ Prototype Pollution in lodash                                │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ lodash                                                       │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ honkit                                                       │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ honkit > @honkit/asciidoc > lodash                           │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://github.com/advisories/GHSA-p6mc-m468-83gw            │
└───────────────┴──────────────────────────────────────────────────────────────┘


┌───────────────┬──────────────────────────────────────────────────────────────┐
│ High          │ Prototype Pollution in lodash                                │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ lodash                                                       │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ honkit                                                       │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ honkit > @honkit/asciidoc > @honkit/html > lodash            │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://github.com/advisories/GHSA-p6mc-m468-83gw            │
└───────────────┴──────────────────────────────────────────────────────────────┘


┌───────────────┬──────────────────────────────────────────────────────────────┐
│ High          │ Prototype Pollution in lodash                                │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ lodash                                                       │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ honkit                                                       │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ honkit > @honkit/asciidoc > @honkit/html > cheerio > lodash  │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://github.com/advisories/GHSA-p6mc-m468-83gw            │
└───────────────┴──────────────────────────────────────────────────────────────┘


# Run  npm update mkdirp --depth 4  to resolve 2 vulnerabilities
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Moderate      │ Prototype Pollution in minimist                              │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ minimist                                                     │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ honkit                                                       │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ honkit > cpr > mkdirp > minimist                             │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://github.com/advisories/GHSA-vh95-rmgr-6w4m            │
└───────────────┴──────────────────────────────────────────────────────────────┘


┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Moderate      │ Prototype Pollution in minimist                              │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ minimist                                                     │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ honkit                                                       │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ honkit > flat-cache > write > mkdirp > minimist              │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://github.com/advisories/GHSA-vh95-rmgr-6w4m            │
└───────────────┴──────────────────────────────────────────────────────────────┘


┌──────────────────────────────────────────────────────────────────────────────┐
│                                Manual Review                                 │
│            Some vulnerabilities require your attention to resolve            │
│                                                                              │
│         Visit https://go.npm.me/audit-guide for additional guidance          │
└──────────────────────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Moderate      │ Inefficient Regular Expression Complexity in nth-check       │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ nth-check                                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=2.0.1                                                      │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ gitbook-plugin-prism                                         │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ gitbook-plugin-prism > cheerio > css-select > nth-check      │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://github.com/advisories/GHSA-rp65-9cf3-cjxr            │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Moderate      │ Inefficient Regular Expression Complexity in nth-check       │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ nth-check                                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=2.0.1                                                      │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ honkit                                                       │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ honkit > juice > cheerio > css-select > nth-check            │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://github.com/advisories/GHSA-rp65-9cf3-cjxr            │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Moderate      │ Inefficient Regular Expression Complexity in nth-check       │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ nth-check                                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=2.0.1                                                      │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ honkit                                                       │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ honkit > @honkit/asciidoc > @honkit/html > cheerio >         │
│               │ css-select > nth-check                                       │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://github.com/advisories/GHSA-rp65-9cf3-cjxr            │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ High          │ Regular Expression Denial of Service in trim-newlines        │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ trim-newlines                                                │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=3.0.1                                                      │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ gitbook-plugin-include-codeblock                             │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ gitbook-plugin-include-codeblock > meow > trim-newlines      │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://github.com/advisories/GHSA-7p7h-4mm5-852v            │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ High          │ Command Injection in lodash                                  │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ lodash                                                       │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=4.17.21                                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ 2335c8d82d8c13c5461d6f17e013c1671de3492b77dd76026b20bba1c89… │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ 2335c8d82d8c13c5461d6f17e013c1671de3492b77dd76026b20bba1c89… │
│               │ > lodash                                                     │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://github.com/advisories/GHSA-35jh-r3h4-6jhm            │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ High          │ Prototype Pollution in lodash                                │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ lodash                                                       │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=4.17.19                                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ 2335c8d82d8c13c5461d6f17e013c1671de3492b77dd76026b20bba1c89… │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ 2335c8d82d8c13c5461d6f17e013c1671de3492b77dd76026b20bba1c89… │
│               │ > lodash                                                     │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://github.com/advisories/GHSA-p6mc-m468-83gw            │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Moderate      │ Prototype Pollution in minimist                              │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ minimist                                                     │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=0.2.1                                                      │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ gitbook-plugin-prism                                         │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ gitbook-plugin-prism > mkdirp > minimist                     │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://github.com/advisories/GHSA-vh95-rmgr-6w4m            │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Moderate      │ Prototype Pollution in minimist                              │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ minimist                                                     │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=0.2.1                                                      │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ gitbook-plugin-wordcount                                     │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ gitbook-plugin-wordcount > html-to-text > optimist >         │
│               │ minimist                                                     │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://github.com/advisories/GHSA-vh95-rmgr-6w4m            │
└───────────────┴──────────────────────────────────────────────────────────────┘
found 16 vulnerabilities (7 moderate, 9 high) in 422 scanned packages
  run `npm audit fix` to fix 8 of them.
  8 vulnerabilities require manual review. See the full report for details.

henrikac avatar Oct 20 '21 12:10 henrikac

I can probably pick up a fix for some of these

ntindle avatar Oct 21 '21 21:10 ntindle

Having looked at this, we would probably have to move these to our own modules and begin fixing from there. There hasn't been fixes upstream for much of this.

ntindle avatar Nov 09 '21 03:11 ntindle

It looks like we need to fix lodash and minimist? Is there any chance of being able to fix these and push them upstream or do we need our own repos?

leios avatar Nov 09 '21 07:11 leios

I don't think lodash and minimist are the problems. I am concerned about the packages using them updating. We may have to fork them to do so.

ntindle avatar Nov 16 '21 00:11 ntindle

Are you talking about honkit, itself?

leios avatar Nov 16 '21 06:11 leios

exactly. You can read the Path part of the table above to find what dependency chain it exists under

ntindle avatar Nov 27 '21 03:11 ntindle