mediamonks / muban

A backend-agnostic framework to enhance server-rendered HTML using a modern webpack development setup.
https://mediamonks.github.io/muban/
39 stars 15 forks source link

Packages audit throw high and critical vulnerabilities for runtime dependencies #191

Open franciscojs12 opened 2 years ago

franciscojs12 commented 2 years ago

Running "muban-core": "^2.1.2".

26 vulnerabilities found - Packages audited: 162 Severity: 8 Low | 4 Moderate | 11 High | 3 Critical

What can we do about this?

Complete audit here:

yarn audit --groups "dependencies" --level high

yarn audit v1.22.5
warning ../../package.json: No license field
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ high          │ Prototype Pollution                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ lodash                                                       │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=4.17.11                                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ modernizr                                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ modernizr > lodash                                           │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://www.npmjs.com/advisories/782                         │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ high          │ Prototype Pollution                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ lodash                                                       │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=4.17.12                                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ modernizr                                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ modernizr > lodash                                           │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://www.npmjs.com/advisories/1065                        │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ high          │ Command Injection                                            │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ lodash                                                       │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=4.17.21                                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ modernizr                                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ modernizr > lodash                                           │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://www.npmjs.com/advisories/1673                        │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ high          │ Arbitrary Code Execution                                     │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ underscore                                                   │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=1.12.1                                                     │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ modernizr                                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ modernizr > remarkable > argparse > underscore               │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://www.npmjs.com/advisories/1674                        │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ critical      │ Prototype Pollution                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ handlebars                                                   │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=4.0.14 <4.1.0 || >=4.1.2                                   │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ muban-convert-hbs                                            │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ muban-convert-hbs > handlebars                               │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://www.npmjs.com/advisories/755                         │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ high          │ Prototype Pollution                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ handlebars                                                   │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=3.0.8 <4.0.0 || >=4.3.0                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ muban-convert-hbs                                            │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ muban-convert-hbs > handlebars                               │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://www.npmjs.com/advisories/1164                        │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ high          │ Arbitrary Code Execution                                     │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ handlebars                                                   │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=3.0.8 <4.0.0 || >=4.5.2                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ muban-convert-hbs                                            │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ muban-convert-hbs > handlebars                               │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://www.npmjs.com/advisories/1316                        │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ high          │ Arbitrary Code Execution                                     │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ handlebars                                                   │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=3.0.8 <4.0.0 || >=4.5.3                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ muban-convert-hbs                                            │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ muban-convert-hbs > handlebars                               │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://www.npmjs.com/advisories/1324                        │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ high          │ Prototype Pollution                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ handlebars                                                   │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=3.0.8 <4.0.0 || >=4.5.3                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ muban-convert-hbs                                            │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ muban-convert-hbs > handlebars                               │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://www.npmjs.com/advisories/1325                        │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ critical      │ Remote code execution when compiling templates               │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ handlebars                                                   │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=4.7.7                                                      │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ muban-convert-hbs                                            │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ muban-convert-hbs > handlebars                               │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://www.npmjs.com/advisories/1670                        │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ high          │ Command Injection                                            │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ lodash                                                       │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=4.17.21                                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ html-extract-data                                            │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ html-extract-data > lodash                                   │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://www.npmjs.com/advisories/1673                        │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ high          │ Command Injection                                            │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ lodash                                                       │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=4.17.21                                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ muban-convert-hbs                                            │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ muban-convert-hbs > handlebars > async > lodash              │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://www.npmjs.com/advisories/1673                        │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ high          │ Prototype Pollution                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ y18n                                                         │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=5.0.5||>=4.0.1 <5.0.0||>=3.2.2 <4.0.0                      │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ modernizr                                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ modernizr > yargs > y18n                                     │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://www.npmjs.com/advisories/1654                        │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ critical      │ Prototype Pollution                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ swiper                                                       │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=6.5.1                                                      │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ swiper                                                       │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ swiper                                                       │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://www.npmjs.com/advisories/1694                        │
└───────────────┴──────────────────────────────────────────────────────────────┘
26 vulnerabilities found - Packages audited: 162
Severity: 8 Low | 4 Moderate | 11 High | 3 Critical
jesse-mm commented 2 years ago

I've checked these packages and most of them are only being used while packaging the project. So these form no risk. We need to check if we can update direct dependencies like modernizr & handlebars.

Btw I didn't see swiper coming back from vulnerable dep list, is this a project specific dependency ?

franciscojs12 commented 2 years ago

@jesse-mm yes, Swiper is a project specific dependency, sorry I didn't filter that out!

franciscojs12 commented 2 years ago

How can I evaluate what kind of actual danger the high/critical vulnerabilities found in modernizr and handlebars actually impose in the project I’m working? Handlebars has prototype pollution, arbitrary code execution and remote code execution when compiling templates. Modernizr has prototype pollution in the y18n dependency

jesse-mm commented 2 years ago

The vulnerabilities are posing a risk mostly when compiling on the build server / or locally. In that case to exploit it an attacker would need to have access to the code / or the machine where it's built on. In the latter case the damage is already done.

I would suggest to read up on this blog post https://overreacted.io/npm-audit-broken-by-design/