Subject: | Perl HTTP Module - Unsecure HTTP_REFERER Leads To Referrer Bypass |
Date: | Thu, 12 Feb 2015 13:44:53 +0530 |
To: | bug-HTTP-Message [...] rt.cpan.org |
From: | Narendra Bhati <bhati.contact [...] gmail.com> |
Respected Authorities,
"HTTP_REFERER" function can be used to ensure that Referrer should be
from trusted domain and it will execute the request if it is not then he
will refuse the complete the request to prevent attacks like CSRF,
Like we can create A Referrer Based CSRF Prevention code
my $refer = $ENV{HTTP_REFERER}; = validwebsite.com
my $website = anything; = validwesite.com
if ($website eq validwebsite.com || $website eq anyother.com) { do this }
else
{ do that }
Now http referer fucntion will check for the referer value which we have
define
and check that if it match then it will execute the request otherwise not
But If we load that page in an tag Iframe who are using "HTTP_REFERER"
function then "HTTP_REFERER" could allow anyone to execute that request ,
Because Iframe Tag Have No Referrer
Suggestion - If Page loaded in an Iframe Then "HTTP_REFERER" functions
should check that if the request if coming from an Iframe then it has to
refuse that request directly to prevent this kind of attacks
Correct me if am wrong !
Looking forward to you
--
*Narendra Bhati "CEH" **( Facebook
<http://www.facebook.com/narendradewsoft> , Twitter
<http://www.twitter.com/NarendraBhatiB> , LinkedIn
<https://www.linkedin.com/profile/view?id=115146074> , Personal Blog
<http://hacktivity.websecgeeks.com> )*