checkmarx:如何求解unsafe_use_of_target_blank问题?
我有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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当不指定目标时(
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 thewindow.open()
method (Reverse Tabnabbing).Setting the opener property to
null
, or specifically setting the target when callingwindow.open
, fixes this vulnerability.You can get more info about "unsafe use of target _blank" here.