Npm audit 在创建新的 react native 项目时显示 9 个漏洞

     2023-03-07     130

关键词:

【中文标题】Npm audit 在创建新的 react native 项目时显示 9 个漏洞【英文标题】:Npm audit shows 9 vulnerabilities upon creating a new react native project 【发布时间】:2018-10-24 14:59:56 【问题描述】:

当我创建一个新的 React 本机项目并运行 npm audit 时,我发现了 9 个漏洞。漏洞列表如下表所示:

│ High          │ Denial of Service                                            │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ ws                                                           │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >= 1.1.5 <2.0.0 || >=3.3.1                                   │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ react-native                                                 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ react-native > react-devtools-core > ws                      │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://nodesecurity.io/advisories/550                       │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Low           │ Prototype Pollution                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ deep-extend                                                  │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=0.5.1                                                      │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ react-native                                                 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ react-native > metro > jest-haste-map > sane > fsevents >    │
│               │ node-pre-gyp > rc > deep-extend                              │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://nodesecurity.io/advisories/612                       │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Low           │ Prototype Pollution                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ deep-extend                                                  │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=0.5.1                                                      │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ jest-expo                                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ jest-expo > jest > jest-cli > jest-haste-map > sane >        │
│               │ fsevents > node-pre-gyp > rc > deep-extend                   │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://nodesecurity.io/advisories/612                       │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Low           │ Prototype Pollution                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ deep-extend                                                  │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=0.5.1                                                      │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ jest-expo                                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ jest-expo > jest > jest-cli > jest-runner > jest-haste-map > │
│               │ sane > fsevents > node-pre-gyp > rc > deep-extend            │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://nodesecurity.io/advisories/612                       │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Low           │ Prototype Pollution                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ deep-extend                                                  │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=0.5.1                                                      │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ jest-expo                                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ jest-expo > jest > jest-cli > jest-runner > jest-runtime >   │
│               │ jest-haste-map > sane > fsevents > node-pre-gyp > rc >       │
│               │ deep-extend                                                  │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://nodesecurity.io/advisories/612                       │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Low           │ Prototype Pollution                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ deep-extend                                                  │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=0.5.1                                                      │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ jest-expo                                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ jest-expo > jest > jest-cli > jest-runtime > jest-haste-map  │
│               │ > sane > fsevents > node-pre-gyp > rc > deep-extend          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://nodesecurity.io/advisories/612                       │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Moderate      │ Prototype pollution                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ hoek                                                         │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ > 4.2.0 < 5.0.0 || >= 5.0.3                                  │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ react-native-scripts [dev]                                   │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ react-native-scripts > xdl > jsonwebtoken > joi > hoek       │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://nodesecurity.io/advisories/566                       │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Moderate      │ Prototype pollution                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ hoek                                                         │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ > 4.2.0 < 5.0.0 || >= 5.0.3                                  │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ react-native-scripts [dev]                                   │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ react-native-scripts > xdl > jsonwebtoken > joi > topo >     │
│               │ hoek                                                         │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://nodesecurity.io/advisories/566                       │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Low           │ Prototype Pollution                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ lodash                                                       │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=4.17.5                                                     │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ react-native                                                 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ react-native > plist > xmlbuilder > lodash                   │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://nodesecurity.io/advisories/577                       │

当我运行 npm outdated 时,一切似乎都是最新的。

任何解决这些问题的帮助将不胜感激。

谢谢

【问题讨论】:

【参考方案1】:

尝试运行 $npm list react-native,它会为您提供包的使用位置和相应版本的概述。我的猜测是,这些并不是最新/需要的。希望这也会有所帮助:npm check and update package if needed... 问题如下:您的包都是最新的,但 npm install 命令不会更新 package.json 文件中这些包的版本。为此,您需要使用 npm-check-updates:How do I update each dependency in package.json to the latest version?

【讨论】:

初始 React npm start 构建失败

...failed【发布时间】:2020-03-2711:34:00【问题描述】:我正在创建一个新的react应用程序,但是当我在npxcreate-react-app之后第一次运行npmstart时,React无法编译。我没有接触任何文件,并且在我创建应用程序的目录中没有其他包。这是... 查看详情

使用“npm audit”时如何只检查高漏洞?

...t;?【发布时间】:2018-10-2303:43:46【问题描述】:当我使用新的npm6执行npminstall时我收到一条消息,告诉我我有一些漏洞:[!]发现75个漏洞[审核了4867个包]严重性:66低|4中等|5高运行npmaudit了解更多详情 查看详情

无法使用 npx create-react-app 创建新的反应应用程序

】无法使用npxcreate-react-app创建新的反应应用程序【英文标题】:Unabletocreatenewreactappwithnpxcreate-react-app【发布时间】:2020-09-1615:48:47【问题描述】:我正在尝试使用npxcreate-react-app[name]命令创建新的反应应用程序。但我收到以下错... 查看详情

创建react项目

...命令行输入: npminstall-gcreate-react-app用create-react-appdemo创建项目进入目录:cddemo     运行项目npmstart 查看详情

在使用 create-react-app 创建项目时有啥方法可以使用 NPM 而不是 Yarn

】在使用create-react-app创建项目时有啥方法可以使用NPM而不是Yarn【英文标题】:IsthereanywaytouseNPMandnotYarnwhilecreatingaprojectwithcreate-react-app在使用create-react-app创建项目时有什么方法可以使用NPM而不是Yarn【发布时间】:2020-09-0508:36:58... 查看详情

ENOLOCK npm 错误!运行 npm audit fix 时出错

】ENOLOCKnpm错误!运行npmauditfix时出错【英文标题】:ENOLOCKnpmERR!Errorwhilerunningnpmauditfix【发布时间】:2021-07-0208:03:50【问题描述】:我正在尝试从我的主目录全局安装一个带有npm的包。安装完成后,它表明存在漏洞。在尝试运行npm... 查看详情

npm install issue:27 个漏洞(16 个中等,9 个高,2 个严重)要解决所有问题,运行:npm audit fix --force

...16个中等,9个高,2个严重)要解决所有问题,运行:npmauditfix--force【英文标题】:npminstallissue:27vulnerabilities(16moderate,9high,2critical)Toaddressallissues,run:npmauditfix--force【发布时间】:2022-01-1017:38:21【问题描述】:当我在相关的react项 查看详情

npm audit 任意文件覆盖

】npmaudit任意文件覆盖【英文标题】:npmauditArbitraryFileOverwrite【发布时间】:2019-09-0206:13:56【问题描述】:我最近使用ngupdate更新了我的Angular版本在运行npmaudit时,它发现了1个高严重性漏洞,但没有提供有关如何解决它的建议。... 查看详情

如何创建自己的 npm starter-kit?

】如何创建自己的npmstarter-kit?【英文标题】:Howtocreateyourownnpmstarter-kit?【发布时间】:2019-02-0203:36:58【问题描述】:艺术开端:流行的node.js框架带有它们自己的作为项目模板的starter-kits,例如React带有starter-kit。当用户想要创... 查看详情

npm audit --parseable 的列名文档?

】npmaudit--parseable的列名文档?【英文标题】:Columnnamedocumentationfornpmaudit--parseable?【发布时间】:2021-03-2922:03:11【问题描述】:有谁知道我在哪里可以找到我可以通过将其与默认的json输出进行比较来猜测一半的列是什么,但我不... 查看详情

创建反应项目时出错

】创建反应项目时出错【英文标题】:Gettingerrorwhilecreatingareactproject【发布时间】:2019-07-3113:58:01【问题描述】:这会出现:在C:\\ProgramFiles\\nodejs\\my-app中创建一个新的React应用程序。\'npm\'未被识别为内部或外部命令,可运行的... 查看详情

无法在 Ubuntu 21.10 上创建新的 React 应用程序

】无法在Ubuntu21.10上创建新的React应用程序【英文标题】:CannotcreateanewReactapplicationwithcreate-react-app【发布时间】:2022-01-1715:31:46【问题描述】:我在创建新的React应用程序时遇到了这个问题(在执行npxcreate-react-appmy-app命令之后)... 查看详情

npm install 给出警告,npm audit fix 不起作用

】npminstall给出警告,npmauditfix不起作用【英文标题】:Npminstallgiveswarnings,npmauditfixnotworking【发布时间】:2019-04-0500:00:39【问题描述】:我正在开发一个带有.net核心webapi的Angular应用程序。当我克隆这个存储库时,我尝试在Angular应... 查看详情

反应原生窗口,产生 npm ENOENT 错误

...错误:C:\\ProgramFiles>react-nativeinitAwesomeProject这将引导你创建一个新的ReactNative项目C:\\ProgramF 查看详情

运行 `npm audit fix` 来修复它们,或运行 `npm audit` 了解详细信息

】运行`npmauditfix`来修复它们,或运行`npmaudit`了解详细信息【英文标题】:Run`npmauditfix`tofixthem,or`npmaudit`fordetails【发布时间】:2020-11-2216:22:58【问题描述】:当我尝试编译项目时,得到:found2860vulnerabilities(2122low,19moderate,726high)run... 查看详情

npm audit 仅适用于生产依赖项?

】npmaudit仅适用于生产依赖项?【英文标题】:npmauditonlyforproductiondependencies?【发布时间】:2018-10-2510:07:05【问题描述】:目前,在项目中运行npmaudit时,它会同时检查dependencies和devDependencies。我正在寻找一种只检查dependencies的方... 查看详情

在 react 中使用自制的 npm 包。编译失败

...:44:33【问题描述】:我跟随https://zellwk.com/blog/publish-to-npm/创建了我的自定义npm包(https://www.npmjs.com/package/demo-to-publish)。我的自定义包的文件夹结 查看详情

创建 React 应用程序:范围错误 - 超出最大调用堆栈大小

】创建React应用程序:范围错误-超出最大调用堆栈大小【英文标题】:CreateReactApp:Rangeerror-Maximumcallstacksizeexceeded【发布时间】:2018-07-0109:40:57【问题描述】:我在尝试创建新的React应用时收到此错误。尝试使用npm更新create-react-app... 查看详情