Skip to content

Instantly share code, notes, and snippets.

@Sebmaster
Last active August 29, 2015 14:20
Show Gist options
  • Save Sebmaster/07c69d56a81128a7ec16 to your computer and use it in GitHub Desktop.
Save Sebmaster/07c69d56a81128a7ec16 to your computer and use it in GitHub Desktop.
JS weirdness
%00.com
%00.com
exec 7 %00.com %00.com 7 %00.com
exec3
%00.com
<NULL>.com
exec 7 %00.com
exec2
console.log(input);
let domain = decodeURIComponent(input);
console.log(decodeURIComponent(input));
console.log("exec", input.length, input, decodeURIComponent(input), domain.length, domain);
if (domain.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|%|\/|:|\?|@|\[|\\|\]/) !== -1) {
console.log("exec2");
throw new TypeError("Invalid Host");
}
console.log("exec3");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment