Skip to content

Instantly share code, notes, and snippets.

@mugukamil
Created January 5, 2016 14:39
Show Gist options
  • Select an option

  • Save mugukamil/96baa938ee3aa9f2e91d to your computer and use it in GitHub Desktop.

Select an option

Save mugukamil/96baa938ee3aa9f2e91d to your computer and use it in GitHub Desktop.
xss security
<SCRIPT>
var pos=document.URL.indexOf("name=")+5;
var name=document.URL.substring(pos,document.URL.length);
if (name.match(/^[a-zA-Z0-9]$/))
{
document.write(name);
}
else
{
window.alert("Security error");
}
</SCRIPT>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment