语境
我正在构建一个sails api,我遇到了一些我正在尝试解决的安全问题。这是我的 package.json
{
"name": "app",
"private": true,
"version": "0.0.0",
"description": "",
"keywords": [],
"dependencies": {
"@sailshq/connect-redis": "^3.2.1",
"@sailshq/lodash": "^3.10.3",
"@sailshq/socket.io-redis": "^5.2.0",
"cron-validator": "^1.2.1",
"dotenv": "^8.2.0",
"moment": "^2.27.0",
"node-schedule": "^1.3.2",
"nodemon": "^2.0.4",
"sails": "^1.4.4",
"sails-hook-orm": "^3.0.2",
"sails-hook-sockets": "^2.0.0",
"sails-postgresql": "^2.0.0",
"uuid": "^8.3.0"
},
"devDependencies": {
"eslint": "5.16.0"
},
"scripts": {
"start": "NODE_ENV=production node app.js",
"test": "npm run lint && npm run custom-tests && echo 'Done.'",
"lint": "./node_modules/eslint/bin/eslint.js . --max-warnings=0 --report-unused-disable-directives && echo '✔ Your .js files look good.'",
"custom-tests": "echo \"(No other custom tests yet.)\" && echo",
"start:dev": "nodemon --inspect app.js"
},
"main": "app.js",
"author": "dev",
"license": "",
"engines": {
"node": "^10.16"
},
"nodemonConfig": {
"ignore": [
"assets/*",
".git/*",
".tmp/*",
"views/*"
]
}
}
当我跑步时,npm audit
我有
29 个漏洞(11 个低、7 个中等、9 个高、2 个严重)
我试图跑步npm audit fix --force
,但我不断遇到问题。
第一次运行npm audit fix --force
以下是版本更改的软件包列表:
- 帆:^1.4.4
- 帆钩orm:^3.0.2
- 帆钩插座:^2.0.0
- 帆-postgresql:^2.0.0
- eslint:5.16.0
通过这些更改,我仍然会遇到这些漏洞:
102 个漏洞(11 个低、9 个中等、70 个高、12 个严重)
第二轮npm audit fix --force
以下是从上次审核修复更改版本的软件包列表:
- 帆:^1.5.0
- 帆钩orm:^3.0.2
- 帆-postgresql:^3.0.0
我仍然有漏洞:
34 个漏洞(9 个低、1 个中等、18 个高、6 个严重)
第三轮npm audit fix --force
以下是从上次审核修复更改版本的软件包列表:
- 帆:^0.12.14
- 帆钩orm:^1.0.9
- 帆钩插座:^2.0.1
- 帆-postgresql:^0.12.2
我仍然有漏洞:
103 个漏洞(12 个低、9 个中等、70 个高、12 个严重)
第四轮npm audit fix --force
以下是从上次审核修复更改版本的软件包列表:
- 帆:^1.5.0
- 帆钩orm:^3.0.2
- 帆钩插座:^1.5.0
- 帆-postgresql:^3.0.0
这是漏洞:
34 个漏洞(9 个低、1 个中等、18 个高、6 个严重)
问题
当我到达第四次运行时,我将我送回第二次运行的配置。我觉得npm audit fix --force
帮不了我。
修复漏洞的最佳方法是什么?(如果有解决方案)