Created
August 21, 2020 14:15
-
-
Save theMiddleBlue/a098f37fbc08b47b2f2ddad8d1579b21 to your computer and use it in GitHub Desktop.
XSS Vulnerable Web Application
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<?php | |
function sanitize_username($username) { | |
return strtr( | |
htmlentities($username, ENT_QUOTES), | |
[';' => ''] | |
); | |
} | |
?> | |
<a href="#!" onclick="javascript:myFunction('/profile/<?php echo sanitize_username($_GET["user"]) ?>')">Profile</a> | |
<script> | |
function myFunction(url) { | |
// do something... | |
location.href=url | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment