语境
在我的 react-native 应用程序中,我遇到了一个关于名为 css-what 的包的严重漏洞。它显然导致了其他 4 个漏洞,因为它们直接或间接地依赖于 css-what。这是执行后我在控制台上得到的以下输出npm audit
css-what <5.0.1
Severity: high
Denial of Service - https://npmjs.com/advisories/1754
fix available via `npm audit fix --force`
Will install react-native-svg@9.12.0, which is a breaking change
node_modules/css-what
css-select <=3.1.2
Depends on vulnerable versions of css-what
node_modules/css-select
react-native-svg >=9.13.0
Depends on vulnerable versions of css-select
node_modules/react-native-svg
@ui-kitten/components >=5.0.0-alpha.1
Depends on vulnerable versions of react-native-svg
node_modules/@ui-kitten/components
@ui-kitten/eva-icons >=5.0.0-alpha.1
Depends on vulnerable versions of react-native-svg
node_modules/@ui-kitten/eva-icons
因此,从输出中可以看出,css-what 导致了包的漏洞,react-native-svg
并且因为我安装的设计系统ui-kitten
依赖于react-native-svg
它,因此随后出现了漏洞。
我查看了 css-what 包和可以在此处看到的漏洞。我知道该漏洞的严重性很高,因为它可能导致拒绝服务。
我试过的
我复制了我的项目,因为我知道运行npm audit fix --force
会导致我在复制项目上运行该命令时所做的破坏性更改。该应用程序能够构建,但在模拟器上运行时引发错误。(请注意,我是从一个裸的 react-native 项目开发的)。
文档给出的说明是将 css-what 更新到 5.0.1,但我不知道如何去做。因此,我希望有人能够在这方面帮助我。