I'm trying to solve an dom xss challenge where filter used is :
var anchor = window.location.hash.substring(1);
if (window.location.href.match(/(script|javascript|src|onerror|%|<|>)/g)) {
alert('xss detected');
After filter is bypassed location hash is written on page through document.write. I can't think of working solution since % is in regex , so no hex and <> is also in filter. Any hint or suggestion in appreciated.