Fortify Scan meldet eine Sicherheitslücke 'Open Redirect' inWie behebe ich Open Redirect Sicherheitslücken in JavaScript?
window.open(strUrl,"_blank", features)
Mein Code:
var features = "status=no, toolbar=no, menubar=no, location=no, top=20, left=175, height=500, width=750";
var strURL = ADMIN_TOOL_SNOOP + "?machineName=" + strMachine + "&template=snoop" +"&context=DEBUG&date=" + strDate.replace(regExp, "");
var validateStrURL = new RegExp("/^[.\\p{Alnum}\\p{Space}]{0,1024}+/", "g");
if(validateStrURL.test(strURL))
{
if((strURL != null)&&(strURL.length !=0)&&(strURL.length <= 200))
{
window.open(strURL,"_blank",features);
}
}
Wie kann ich das Problem beheben?
Vielen Dank! Das ist schön erklärt. –
Wie zu beheben, wenn Query String Wert dynamisch ist, d. H. Textfeld Wert? window.open ('redirect.php? Destination =' + paramvalue); –