From ea2e012df4312a8f97a02320934cab70f90d5aed Mon Sep 17 00:00:00 2001 From: tomer-mobb <132216976+tomer-mobb@users.noreply.github.com> Date: Tue, 23 Jan 2024 20:54:42 +0700 Subject: [PATCH] Update xss-example.js --- xss-example.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xss-example.js b/xss-example.js index c39e9a03..eee8ab51 100644 --- a/xss-example.js +++ b/xss-example.js @@ -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;