jQuery-包括具有已知安全漏洞的前端JavaScript库

发布于 2025-02-05 05:14:57 字数 846 浏览 2 评论 0原文

我使用Google Lighthouse对网站进行了优化分析,“最佳实践”问题之一是:

一些第三方脚本可能包含已知的安全漏洞,这些漏洞易于识别和利用攻击者。

分析可以帮助您带有此文件。

jQuery >我实际上没有使用它,但是该项目具有Bootstrap 4,所以我需要库,目前迁移到Bootstrap 5非常复杂。

我从app.js导入jQuery:

import 'jquery';
import $ from 'jquery';
window.$ = window.jQuery = $;
import 'jquery-ui/ui/widgets/datepicker.js';

从软件包中安装的NPM的版本。JSON如下:

"dependencies": {
    "jquery": "^3.5.1",
    "jquery-ui": "^1.12.1"
}

我能做什么?也许尝试一些不同的jQuery版本,但我不确定哪个版本与我的项目兼容。

I did an optimization analysis of my website with Google Lighthouse and one of the "Best Practices" issues is as follows:

Some third-party scripts may contain known security vulnerabilities that are easily identified and exploited by attackers.

And the analysis helps you with this documentation.

The problem is with the jQuery [email protected] library, I don't actually use it but that project has Bootstrap 4 so i need the library, migrating to Bootstrap 5 is very complicated at the moment.

I import JQuery from app.js like this:

import 'jquery';
import $ from 'jquery';
window.$ = window.jQuery = $;
import 'jquery-ui/ui/widgets/datepicker.js';

The version installed with npm from the package.json is as follows:

"dependencies": {
    "jquery": "^3.5.1",
    "jquery-ui": "^1.12.1"
}

What I can do? Maybe try some different JQuery version, but I'm not sure which one is compatible with my project.

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

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

发布评论

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

评论(2

天生の放荡 2025-02-12 05:14:58

尝试将3.6.0版添加

  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"
  type="text/javascript"></script>

到您的代码头中,然后再次运行灯塔报告。

try adding the version 3.6.0 as shown below

  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"
  type="text/javascript"></script>

to your code head and run the lighthouse report again.

多孤肩上扛 2025-02-12 05:14:57

建议

单击报告库版本中的链接您的报告列以了解有关每个库的漏洞的更多信息。

如果库发布了修复漏洞的较新版本,请升级到该版本

以查看数据库,jQuery UI有许多问题 - 但所有报告的问题均适用于1.13.0以下的版本。

因此,只需升级到1.13.0或以后。他们使用语义版本操作,因此从.12更改为.13不应引入任何向后兼容的更改。

The recommendation is to

Click the links in the Library Version column of your report to learn more about each library's vulnerabilities.

If the library has released a newer version that fixes the vulnerability, upgrade to that version

Looking at the linked vulnerability database, there are a number of issues with jQuery UI - but all of the reported issues are for versions below 1.13.0.

So, just upgrade to 1.13.0 or later. They use semantic versioning, so changing from .12 to .13 should not introduce any backwards-incompatible changes.

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