I have this URL that I sometimes use to redirect my users. It looks like:
https://mywebsite.com/?redirectTo=
However, I'm checking if the domain part of the parameter ends with:
google.com
mydomains.com
and some other domains I consider valid.
So. Can someone can and hack my website if I have those checks in place?
https://mywebsite.com/?redirectTo=https://google.com.attacker.net/
. But if this results only in the redirect this is not really a hack of the website but only a misuse using an open redirect vulnerability. – Steffen Ullrich Mar 17 '19 at 18:11.google.com$
+^google.com$
, notgoogle.com$
also matchingattackersgoogle.com
. – Esa Jokinen Mar 17 '19 at 18:38