在我的代碼(UI5 專案)的以下行中,我有 3次來自Checkmarx的“Unsafe_Use_Of_Target_blank”漏洞:
window.open(new URL(sCustomUrl).origin "/" sParam);
window.open(sCustomUrl this.getView().getModel().getProperty("/ID"));
window.open(this.urlToID);
如何消除這些行中的問題?
uj5u.com熱心網友回復:
當沒有指定目標時(沒有第二個引數window.open,或者它是一個空字串或"_blank"),打開的視窗可以訪問執行該window.open()方法的頁面(反向 Tabnabbing)。
將 opener 屬性設定為null,或者在呼叫時專門設定 target window.open,可以修復此漏洞。
您可以在此處獲取有關“不安全使用目標 _blank”的更多資訊。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/474331.html
標籤:javascript 安全 代码分析 检查马克思
