Add files via upload

This commit is contained in:
gulsahdemiryurek
2025-07-10 15:56:40 +03:00
committed by GitHub
parent 76d1c888ff
commit 1ed52bfb81
2 changed files with 180 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
<!-- xss_vulnerable.html -->
<!DOCTYPE html>
<html>
<head>
<title>XSS Vulnerability Example</title>
</head>
<body>
<h1>Leave a Comment</h1>
<form method="GET">
<input type="text" name="comment" placeholder="Enter your comment" />
<input type="submit" value="Submit" />
</form>
<h2>Your Comment:</h2>
<p>
<!-- Vulnerable: User input is printed directly without sanitization -->
<!-- Example attack: ?comment=<script>alert('xss')</script> -->
<script>
const params = new URLSearchParams(window.location.search);
document.write(params.get("comment"));
</script>
</p>
</body>
</html>