From:             motion_4u at hotmail dot com
Operating system: all
PHP version:      4.3.10
PHP Bug Type:     URL related
Bug description:  getenv('HTTP_REFERER') failure

Description:
------------
This page includes an included file called "refer.php" containing 2 lines
as followed:

<? $refer=getenv('HTTP_REFERER');
return $refer; ?> 

If the function "getenv('HTTP_REFERER')" works correctly, you should see
the URL of this subdirectory + "refer.php" below 

REFERER: <-- You see nothing! 

the code for this file is as followed: 

<?
$ref=include "refer.php";
echo $ref;
?> 

The basic purpose of "getenv('HTTP_REFERER')" function is very simple! It
has to return the URL of the caller.
At the first glance it seems as something not important at all but
actually it is a major
security problem for those who rely on the "getenv('HTTP_REFERER')"
function to
identify the caller page to return a hidden value using the "include"
function back
only to a predefined URL. 

Reproduce code:
---------------
You can access the URL to test it right here:
http://motion4u.sytes.net/phpreferertest/index.php

Expected result:
----------------
Must return an URL and not nothing! 
You get even no NULL!

Actual result:
--------------
OK, I keep it as short as possible! only one word :

Zilch

-- 
Edit bug report at http://bugs.php.net/?id=31460&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=31460&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=31460&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=31460&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=31460&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=31460&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=31460&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=31460&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=31460&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=31460&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=31460&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=31460&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=31460&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=31460&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=31460&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=31460&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=31460&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=31460&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=31460&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=31460&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=31460&r=mysqlcfg

Reply via email to