Is header redirection injectable
Its all begin with the a redirect function I have used to enable language
switching. I use header('Location: ' . $_SERVER['HTTP_REFERER']); to
redirect user back to his previous page which is redirected through
javascript window.location.href .
I've tried
$_SERVER['HTTP_REFERER']=');';
header('Location: ' . $_SERVER['HTTP_REFERER']);
and it redirected to an error page http://localhost/);
However I know that there might be some trick to make it a leakage,
therefore I'm asking is there any injection method to this? I won't mind
to let user modify their http_referer and send to an error page if the
code is not vulnerable.
No comments:
Post a Comment