koajs / koa-hbs

Handlebars templates for Koa.js
MIT License
159 stars 43 forks source link

Vulnerabilities reported by nsp #49

Closed SamFromDaUk closed 7 years ago

SamFromDaUk commented 8 years ago

Hi Guys

Ive been running nsp on some of my apps and nsp is reporting 3 vulnerabilities in the dependencies

(+) 3 vulnerabilities found
┌───────────────┬────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│               │ Quoteless Attributes in Templates can lead to Content Injection                                                                    │
├───────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Name          │ handlebars                                                                                                                         │
├───────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Installed     │ 2.0.0                                                                                                                              │
├───────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Vulnerable    │ <4.0.0                                                                                                                             │
├───────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Patched       │ >=4.0.0                                                                                                                            │
├───────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Path          │ astroguide@1.0.0 > koa-hbs@0.8.0 > handlebars@2.0.0                                                                                │
├───────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ More Info     │ https://nodesecurity.io/advisories/61                                                                                              │
└───────────────┴────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
┌───────────────┬────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│               │ Regular Expression Denial of Service                                                                                               │
├───────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Name          │ uglify-js                                                                                                                          │
├───────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Installed     │ 2.3.6                                                                                                                              │
├───────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Vulnerable    │ <2.6.0                                                                                                                             │
├───────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Patched       │ >=2.6.0                                                                                                                            │
├───────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Path          │ astroguide@1.0.0 > koa-hbs@0.8.0 > handlebars@2.0.0 > uglify-js@2.3.6                                                              │
├───────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ More Info     │ https://nodesecurity.io/advisories/48                                                                                              │
└───────────────┴────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
┌───────────────┬────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│               │ Incorrect Handling of Non-Boolean Comparisons During Minification                                                                  │
├───────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Name          │ uglify-js                                                                                                                          │
├───────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Installed     │ 2.3.6                                                                                                                              │
├───────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Vulnerable    │ <= 2.4.23                                                                                                                          │
├───────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Patched       │ >= 2.4.24                                                                                                                          │
├───────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Path          │ astroguide@1.0.0 > koa-hbs@0.8.0 > handlebars@2.0.0 > uglify-js@2.3.6                                                              │
├───────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ More Info     │ https://nodesecurity.io/advisories/39                                                                                              │
└───────────────┴──────────────────────────────────────────────────
shellscape commented 8 years ago

so it looks like we just need to update handlebars. I'm not sure what the ramifications of that will be, I'll have to do some poking around, but that's good to know.

felixjung commented 8 years ago

Is this related to minimatch? I can see that koa-hbs's depends on a very outdated version of glob, which in turn depends on an outdated version of minimatch (0.3.0). When npm installing, I get the following warning:

npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or 
higher to avoid a RegExp DoS issue.

Can we update just that for now? I'm passing in my own handlebars instance.

shellscape commented 8 years ago

this week is a little nuts because of the short workweek. a PR that passes tests would be welcome, otherwise it may have to wait until this weekend/next week.

felixjung commented 8 years ago

Sure, I can check that.

felixjung commented 8 years ago

There you go 😄

shellscape commented 7 years ago

As of 0.9.0 (pending release) nsp reports no vulnerabilities found.