Skip to content

Instantly share code, notes, and snippets.

@corazzi
Last active July 10, 2017 09:04
Show Gist options
  • Save corazzi/16c27ebdef0be24cfedb00060a126dfc to your computer and use it in GitHub Desktop.
Save corazzi/16c27ebdef0be24cfedb00060a126dfc to your computer and use it in GitHub Desktop.
Test sanitised user input with this list of possible vectors of attack
// Javascript
<script>alert('Test');<script>
// PHP
<?php echo 'Test echo 1'; ?>
<?= 'Test echo 2' ?>
<?php include('non_existent_file'); ?>
<?php require('non_existent_file'); ?>
// HTML
<div>You should see div tags</div>
<span>You should see span tags</span>
<b>You may want to see b tags</b>
<i>You may want to see i tags</i>
<u>You may want to see u tags</u>
<strong>You may want to see strong tags</strong>
<em>You may want to see em tags</em>
You <br> may <br /> want to see br tags – otherwise this line should be split up
@corazzi
Copy link
Author

corazzi commented Jul 10, 2017

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