Skip to content

Instantly share code, notes, and snippets.

@EverfreeFaerie
Last active August 6, 2016 11:39
Show Gist options
  • Save EverfreeFaerie/9ae10e2f3ba53b283fca to your computer and use it in GitHub Desktop.
Save EverfreeFaerie/9ae10e2f3ba53b283fca to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<title>XSS-Example</title>
</head>
<body>
<?php if(isset($_GET['text'])) { ?>
<p>You typed: <?php echo $_GET['text']; ?></p>
<?php } ?>
<form>
<textarea name="text"></textarea>
<input type="submit"/>
</form>
</body>
</html>
@EverfreeFaerie
Copy link
Author

EverfreeFaerie commented Mar 24, 2016

THIS IS HOW NOT TO PUT USER INPUT INTO RESPONSE!

Try it by submitting <script>alert('XSS');</script> to the form.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment