dcloudio / dcloudio/uni-app

依赖版本太老 使用 npm audit 或者 yarn audit 会有高危安全漏洞报告

Open
#2,857 0 comments 0 reactions 1 assignee Claimed by @zhetengbiji View on GitHub
doubleCheck
Dominant language
JavaScript
Stars
41.6k
Forks
3.7k
Avg merge
7h 6m
Merged PRs (30d)
6

Description

**问题描述**
检测项目安全信息
```ruby
npm audit # 或者 yarn audit
```
会报多个安全漏洞

**复现步骤**
1. cli 新建项目
```ruby
vue create -p dcloudio/uni-preset-vue test
```
2. 等待项目安装完成 执行
```ruby
cd test
yarn audit
```
3. 会输出如下信息
```ruby
yarn audit v1.22.11
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ high │ Timing Attack │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package │ jsrsasign │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in │ >=8.0.13 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ @dcloudio/uni-quickapp-native │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ @dcloudio/uni-quickapp-native > @hap-toolkit/dsl-vue > │
│ │ @hap-toolkit/packager > jsrsasign │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info │ https://www.npmjs.com/advisories/1505 │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ high │ Timing Attack │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package │ jsrsasign │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in │ >=8.0.13 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ @dcloudio/uni-quickapp-native │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ @dcloudio/uni-quickapp-native > @hap-toolkit/server > │
│ │ @hap-toolkit/packager > jsrsasign │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info │ https://www.npmjs.com/advisories/1505 │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ high │ Timing Attack │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package │ jsrsasign │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in │ >=8.0.13 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ @dcloudio/uni-quickapp-native │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ @dcloudio/uni-quickapp-native > @hap-toolkit/packager > │
│ │ jsrsasign │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info │ https://www.npmjs.com/advisories/1505 │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ moderate │ Improper Verification of Cryptographic Signature │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package │ jsrsasign │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in │ >=8.0.17 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ @dcloudio/uni-quickapp-native │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ @dcloudio/uni-quickapp-native > @hap-toolkit/dsl-vue > │
│ │ @hap-toolkit/packager > jsrsasign │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info │ https://www.npmjs.com/advisories/1541 │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ moderate │ Improper Verification of Cryptographic Signature │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package │ jsrsasign │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in │ >=8.0.17 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ @dcloudio/uni-quickapp-native │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ @dcloudio/uni-quickapp-native > @hap-toolkit/server > │
│ │ @hap-toolkit/packager > jsrsasign │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info │ https://www.npmjs.com/advisories/1541 │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ moderate │ Improper Verification of Cryptographic Signature │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package │ jsrsasign │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in │ >=8.0.17 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ @dcloudio/uni-quickapp-native │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ @dcloudio/uni-quickapp-native > @hap-toolkit/packager > │
│ │ jsrsasign │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info │ https://www.npmjs.com/advisories/1541 │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ critical │ RSA signature validation vulnerability │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package │ jsrsasign │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in │ >=10.2.0 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ @dcloudio/uni-quickapp-native │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ @dcloudio/uni-quickapp-native > @hap-toolkit/dsl-vue > │
│ │ @hap-toolkit/packager > jsrsasign │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info │ https://www.npmjs.com/advisories/1672 │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ critical │ RSA signature validation vulnerability │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package │ jsrsasign │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in │ >=10.2.0 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ @dcloudio/uni-quickapp-native │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ @dcloudio/uni-quickapp-native > @hap-toolkit/server > │
│ │ @hap-toolkit/packager > jsrsasign │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info │ https://www.npmjs.com/advisories/1672 │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ critical │ RSA signature validation vulnerability │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package │ jsrsasign │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in │ >=10.2.0 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ @dcloudio/uni-quickapp-native │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ @dcloudio/uni-quickapp-native > @hap-toolkit/packager > │
│ │ jsrsasign │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info │ https://www.npmjs.com/advisories/1672 │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ high │ Prototype Pollution │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package │ merge │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in │ >=2.1.1 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ @dcloudio/webpack-uni-pages-loader │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ @dcloudio/webpack-uni-pages-loader > merge │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info │ https://www.npmjs.com/advisories/1666 │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ moderate │ Regular expression denial of service │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package │ glob-parent │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in │ >=5.1.2 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ @dcloudio/vue-cli-plugin-uni │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ @dcloudio/vue-cli-plugin-uni > copy-webpack-plugin > │
│ │ 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 │ @vue/cli-service │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ @vue/cli-service > copy-webpack-plugin > 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 │ @vue/cli-plugin-babel │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ @vue/cli-plugin-babel > 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 │ @vue/cli-plugin-typescript │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ @vue/cli-plugin-typescript > 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 │ @vue/cli-service │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ @vue/cli-service > 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 │ @dcloudio/uni-quickapp-native │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ @dcloudio/uni-quickapp-native > @hap-toolkit/dsl-vue > │
│ │ @hap-toolkit/compiler > 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 │ @dcloudio/uni-quickapp-native │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ @dcloudio/uni-quickapp-native > @hap-toolkit/dsl-vue > │
│ │ @hap-toolkit/packager > @hap-toolkit/compiler > 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 │ @dcloudio/uni-quickapp-native │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ @dcloudio/uni-quickapp-native > @hap-toolkit/server > │
│ │ @hap-toolkit/packager > @hap-toolkit/compiler > 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 │ @dcloudio/uni-quickapp-native │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ @dcloudio/uni-quickapp-native > @hap-toolkit/packager > │
│ │ @hap-toolkit/compiler > 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 │ @dcloudio/uni-quickapp-native │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ @dcloudio/uni-quickapp-native > @hap-toolkit/dsl-vue > │
│ │ @hap-toolkit/packager > 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 │ @dcloudio/uni-quickapp-native │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ @dcloudio/uni-quickapp-native > @hap-toolkit/server > │
│ │ @hap-toolkit/packager > 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 │ @dcloudio/uni-quickapp-native │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ @dcloudio/uni-quickapp-native > @hap-toolkit/packager > │
│ │ 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 │ @vue/cli-service │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ @vue/cli-service > webpack-dev-server > 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 │ @vue/cli-plugin-typescript │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ @vue/cli-plugin-typescript > globby > fast-glob > │
│ │ 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 │ @vue/cli-service │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ @vue/cli-service > globby > fast-glob > glob-parent │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info │ https://www.npmjs.com/advisories/1751 │
└───────────────┴──────────────────────────────────────────────────────────────┘
25 vulnerabilities found - Packages audited: 1699
Severity: 18 Moderate | 4 High | 3 Critical
✨ Done in 3.98s.
```
其中 **jsrsasign0.6.13** 依赖路径 **@dcloudio/uni-quickapp-native > @hap-toolkit/packager > jsrsasign**
由于版本过低 会有多个高危漏洞 看源码里面还是两年前的版本
https://github.com/dcloudio/uni-app/blob/c1c4299a0ecfe8b10d878db4a4b6688609613c31/packages/uni-quickapp-native/package.json#L29

[@hap-toolkit/packager 0.6.13](https://www.npmjs.com/package/@hap-toolkit/packager/v/0.6.13)

**merge1.2.1** 依赖路径 **@dcloudio/webpack-uni-pages-loader > merge** 会有一个原型污染的漏洞
https://github.com/dcloudio/uni-app/blob/c1c4299a0ecfe8b10d878db4a4b6688609613c31/packages/webpack-uni-pages-loader/package.json#L20
[merge 1.2.1](https://www.npmjs.com/package/merge/v/1.2.1)

**预期结果**
没有高危漏洞

**实际结果**
包jsrsasign 和merge 由于版本过低会有高危漏洞

**系统信息:**
- uni-app版本 2.0.0-32220210818002 以前的估计也有这个问题

**补充信息**
希望可以升级一下相关依赖

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.