问题描述
我正在尝试将 nuxt 用于我的应用程序,但是当我运行“纱线审核”时,存在一些审核问题,这些问题是 nuxt 的依赖项。
我是否必须解决这些审核问题?如果我必须这样做,我该如何解决?
我使用的是 nuxt 2.15.7 并且我添加了最新的 css-what
但它没有改变。
yarn audit v1.22.10
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ moderate │ Regular expression denial of service │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package │ glob-parent │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in │ >=5.1.2 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ nuxt │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ nuxt > @nuxt/builder > @nuxt/webpack > webpack > watchpack > │
│ │ watchpack-chokidar2 > chokidar > glob-parent │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info │ https://www.npmjs.com/advisories/1751 │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ moderate │ Regular expression denial of service │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package │ glob-parent │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in │ >=5.1.2 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ nuxt │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ nuxt > @nuxt/webpack > webpack > watchpack > │
│ │ watchpack-chokidar2 > chokidar > glob-parent │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info │ https://www.npmjs.com/advisories/1751 │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ high │ Denial of Service │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package │ css-what │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in │ >=5.0.1 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ nuxt │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ nuxt > @nuxt/builder > @nuxt/webpack > cssnano > │
│ │ cssnano-preset-default > postcss-svgo > svgo > css-select > │
│ │ css-what │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info │ https://www.npmjs.com/advisories/1754 │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ high │ Denial of Service │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package │ css-what │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in │ >=5.0.1 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ nuxt │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ nuxt > @nuxt/webpack > cssnano > cssnano-preset-default > │
│ │ postcss-svgo > svgo > css-select > css-what │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info │ https://www.npmjs.com/advisories/1754 │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ high │ Denial of Service │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package │ css-what │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in │ >=5.0.1 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ nuxt │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ nuxt > @nuxt/builder > @nuxt/webpack > │
│ │ optimize-css-assets-webpack-plugin > cssnano > │
│ │ cssnano-preset-default > postcss-svgo > svgo > css-select > │
│ │ css-what │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info │ https://www.npmjs.com/advisories/1754 │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ high │ Denial of Service │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package │ css-what │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in │ >=5.0.1 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ nuxt │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ nuxt > @nuxt/webpack > optimize-css-assets-webpack-plugin > │
│ │ cssnano > cssnano-preset-default > postcss-svgo > svgo > │
│ │ css-select > css-what │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info │ https://www.npmjs.com/advisories/1754 │
└───────────────┴──────────────────────────────────────────────────────────────┘
6 vulnerabilities found - Packages audited: 1199
Severity: 2 Moderate | 4 High
Done in 1.67s.
$yarn list --pattern css-what
yarn list v1.22.10
├─ css-what@5.0.1
└─ svgo@1.3.2
└─ css-what@3.4.2
解决方法
由于严重性是 moderate/high
并且它是 Denial of Service
,所以您真的不必担心。万一有大 critical
一个,互联网、Github 和你的同事会提醒你。
至于修复它,没有 yarn audit fix
中的 npm
,但是我们可以使用 npm
来修复它们或使用 Yarn 手动修复它们,这是一篇不错的文章关于如何实现这一点:https://javascriptbit.com/yarn-audit-fix-security-issues/