Skip to content

Commit

Permalink
Update xss-example.js
Browse files Browse the repository at this point in the history
  • Loading branch information
tomer-mobb authored Jan 23, 2024
1 parent 00c3f68 commit ea2e012
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion xss-example.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ var urlParams = new URLSearchParams(window.location.search);
var username = urlParams.get('username');

var unsafe_div = window.document.getElementById("vulnerable-div");
unsafe_div.innerHTML = "Hello to you ";
// here's an XSS:
unsafe_div.innerHTML = "Hello to you " + username;

0 comments on commit ea2e012

Please sign in to comment.