React更新更新过时的依赖项由CheckMarx标记

发布于 2025-01-24 15:52:30 字数 275 浏览 5 评论 0原文

在我的项目中,我有一些过时的依赖关系,这些依赖性已由 checkmarx 标记。

但是,标记的依赖项在react-scripts版本4.0.3中。例如,react-scripts中有标记的软件包,即ejsimmerurl-parse,<代码>调试等等。

可以单独升级这些软件包的最佳方法是什么?

In my project, I have some outdated dependencies that have been flagged by Checkmarx.

However, the dependencies flagged are in react-scripts version 4.0.3. For example, there are packages flagged within react-scripts, i.e ejs, immer, url-parse, debug and some more.

What would be the best way to upgrade these packages, individually or update to the latest react-scripts version, would that solve it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

゛清羽墨安 2025-01-31 15:52:30

我是CheckMarx的安全研究员Ravid。
请允许我解决您的问题。

解决此问题的最佳方法是将“ root”(在这种情况下在这种情况下)更新为最新版本。

一旦您将此软件包更新为其最新版本(5.0.1),及时依赖项(又称孩子)将相应地更新。
例如,React-Scripts使用React-dev-Utils使用浸入式的词,一旦将反应标记更新为最新版本,您会注意到它使用了最新版本的Immerer。

请注意,一个项目可能会使用同一软件包的一些不同版本。
例如,React-Scripts(最新)使用版本4.3.4(最新)以及2.69和3.27中的调试。

重要的是要记住,即使更新了“根”软件包后,可能仍会过时的“儿童”软件包,因为某些软件包仍在使用脆弱/过时的软件包版本。

一个例子是:

”在此处输入图像描述”

如您所见,React-Scripts(最新)使用WebPack-Dev-Server(最新)使用Portfinder(最新),该portfinder(最新)使用debug 3.2.7(不是最新的) )
“问题”依赖于投资通过,该投资通过不使用最新版本的调试。

关于更新依赖项后的断点代码,CheckMarx具有一个引擎,该引擎将警告目前断开的方法,行和文件,此功能仅是内部的,但应尽快准备就绪

I'm Ravid, a security researcher in Checkmarx.
Please allow me to address your question.

The best way to work around this issue is to update the "root" (react-scripts in this case) to the latest version.

Once you will update this package to its latest version (5.0.1), the transitive dependencies (AKA the children) will get updated accordingly.
For example, react-scripts uses react-dev-utils which uses immer, once updating react-scripts to the latest, you will notice it uses the latest version of immer.
latest immer

Please note that a project might use a few different versions of the same package.
For example, react-scripts (latest) uses debug in versions 4.3.4 (latest) as well as 2.69 and 3.27.

It is important to remember then even after updating the "root" package there might still be outdated "children" packages, since some packages are still using vulnerable/outdated package versions.

An example of that would be:

enter image description here

As you can see, react-scripts (latest) uses webpack-dev-server (latest) which uses portfinder (latest) which uses debug 3.2.7 (NOT latest)
The "problem" relies on portfinder, which does not uses the latest version of debug.

Regarding breaking code after updating the dependencies, Checkmarx have an engine that will alert the method, line, and file that was broken At the moment, this feature is internal only but should be production-ready soon enough code breaks

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文