首页 > 解决方案 > 在 npm install 之后我收到错误:Prototype Pollution in set-value

问题描述

我在 React Native 中有一个应用程序,当我运行 npm install 时,我收到此错误“在 1182 个扫描包中发现 15 个漏洞(5 个中等漏洞,10 个高漏洞)”。运行 npm audit 后,大部分错误包含以下内容:

设定值高原型污染

包装设定值

已修补 >=4.0.1

react-native 的依赖

路径 react-native > @react-native-community/cli > @react-native-community/cli-plugin-metro > metro-config > metro-core > jest-haste-map > sane > anymatch > micromatch > 大括号 > snapdragon > 基础 > 缓存基础 > 设置值

更多信息 https://github.com/advisories/GHSA-4jqc-8m5r-9rpr

和这个:

chalk/ansi-regex 中的中度低效正则表达式复杂性

包 ansi 正则表达式

已修补 >=5.0.1

react-native 的依赖

路径 react-native > @react-native-community/cli > strip-ansi > ansi-regex

更多信息 https://github.com/advisories/GHSA-93q8-gq69-wqmw

谁能帮我解决这些问题?

标签: javascriptnode.jsreactjsreact-native

解决方案


Moderate Inefficient Regular Expression Complexity in chalk/ansi-regex参阅 Qix 对以下线程的评论:https ://github.com/chalk/ansi-regex/commit/8d1d7cdb586269882c4bdc1b7325d0c58c8f76f9

tldr:在用户输入到达 API 之前对其进行清理(如果适用)


推荐阅读