checkmarx:如何求解unsafe_use_of_target_blank问题?

发布于 2025-01-27 12:41:52 字数 326 浏览 5 评论 0原文

我有3次发生“ unsafe_use_of_target_blank” sceckmarx 漏洞,在我的代码的以下几行(UI5项目)中:

window.open(new URL(sCustomUrl).origin + "/" + sParam);

window.open(sCustomUrl + this.getView().getModel().getProperty("/ID"));

window.open(this.urlToID);

我如何消除这些行中的问题?

I have 3 occurances of "Unsafe_Use_Of_Target_blank" vulnerability from Checkmarx, in the following lines of my code (UI5 project):

window.open(new URL(sCustomUrl).origin + "/" + sParam);

window.open(sCustomUrl + this.getView().getModel().getProperty("/ID"));

window.open(this.urlToID);

How can I eliminate the issue in these lines?

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

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

发布评论

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

评论(1

反话 2025-02-03 12:41:52

当不指定目标时(window.popen没有第二个参数,或空字符串“ _ blank”),打开的窗口获得对执行window.open()方法的页面的一些访问权反向tabnabbing )。

将开启器属性设置为null,或在调用window.popen时专门设置目标,请修复此漏洞。

您可以获取有关“不安全使用目标_blank”的更多信息。

When not specifying the target (no second parameter for window.open, or it an empty string or "_blank"), the opened window gains some access to the page that executed the window.open() method (Reverse Tabnabbing).

Setting the opener property to null, or specifically setting the target when calling window.open, fixes this vulnerability.

You can get more info about "unsafe use of target _blank" here.

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