Skip to content

Instantly share code, notes, and snippets.

@yalovek
Created August 29, 2016 11:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yalovek/c10b92a980fc0ff2bb76661fae239719 to your computer and use it in GitHub Desktop.
Save yalovek/c10b92a980fc0ff2bb76661fae239719 to your computer and use it in GitHub Desktop.
Check url params for XSS: window.location = 'javascript://a%0aalert%28document.cookie%29'
window.location.search.substr(1).split('&').map(value => {
return value.split('=')[1];
}).filter(value => {
const parser = document.createElement('a');
parser.href = value;
return parser.protocol === "javascript:";
}).length;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment