# npm audit report
nth-check <2.0.1
Severity: high
Inefficient Regular Expression Complexity in nth-check - https://github.com/advisories/GHSA-rp65-9cf3-cjxr
fix available via `npm audit fix --force`
Will install react-scripts@2.1.3, which is a breaking change
node_modules/svgo/node_modules/nth-check
css-select <=3.1.0
Depends on vulnerable versions of nth-check
node_modules/svgo/node_modules/css-select
svgo 1.0.0 - 1.3.2
Depends on vulnerable versions of css-select
node_modules/svgo
@svgr/plugin-svgo <=5.5.0
Depends on vulnerable versions of svgo
node_modules/@svgr/plugin-svgo
@svgr/webpack 4.0.0 - 5.5.0
Depends on vulnerable versions of @svgr/plugin-svgo
node_modules/@svgr/webpack
react-scripts >=2.1.4
Depends on vulnerable versions of @svgr/webpack
node_modules/react-scripts
6 high severity vulnerabilities
To address all issues (including breaking changes), run:
npm audit fix --force
我使用npm 8.12.1和节点16.15.1。反应性图标刚刚发布了它的4.4.0,我试着安装它,并在这条消息中结束。我试过npm审计修复-强制。脆弱性和强烈性保持不变。我想听听你对这个消息的看法。因此,如果反作用图标是不安全的,哪一个包是图标的替代方案?
发布于 2022-06-07 03:31:34
也有类似的问题。这让我明白了。
https://github.com/facebook/create-react-app/issues/11174
编辑:
npm审核在前端工具设计中被打破。
更多阅读:https://overreacted.io/npm-audit-broken-by-design/
创建React是一个构建工具。换句话说,它不会生成正在运行的Node应用程序。它在开发过程中在构建时运行,并生成静态资产。然而,npm审核是为Node应用程序设计的,因此它会标记在生产中运行实际Node代码时可能出现的问题。这绝对不是Create的工作方式。这意味着,我们收到的大量关于传递依赖的“漏洞”报告都是假的。尽管有上百个问题,数千条关于国家预防机制审计警告的评论都是有反应的--多年来,没有一个脚本(据我们所知)是CRA用户真正的弱点。
如果您仍然想修复这些警告:
Open package.json.你会发现:
"dependencies": { "react": "^17.0.2", "react-dom": "^17.0.2", "react-scripts": "4.0.3" }
采用react脚本并将其移动到devDependencies (如果您没有它,请创建它):
"dependencies": { "react": "^17.0.2", "react-dom": "^17.0.2" }, "devDependencies": { "react-scripts": "4.0.3" },
然后,
确保您运行的是
npm audit --production
而不是npm audit
。这将修复您的警告。
发布于 2022-07-10 01:59:45
并非所有的漏洞都是相同的。我有一个完全相同的错误,进一步的研究表明它是常见的--在我的例子中--它可以被忽略(使用npm view nth-check version
显示我有一个比错误提示的更晚的版本,而且我不认为该漏洞会带来安全问题)
也不要盲目使用npm audit fix --force
。例如,在我的例子中,它将强制降级nth-check和react脚本版本,这将带来可能更糟糕的漏洞。
对此的进一步研究表明,没有0漏洞是非常正常/常见的吗?每个人都需要权衡你所建立的东西的价值,所以这很可能是一个个人研究的决定。
https://stackoverflow.com/questions/72489256
复制相似问题