Bug #64582 [Opn]: file_get_contents() handles redirects wrong

From: Date: Thu, 04 Apr 2013 15:57:09 +0000
Subject: Bug #64582 [Opn]: file_get_contents() handles redirects wrong
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-178294@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=64582&edit=1

 ID:                 64582
 User updated by:    spam2 at rhsoft dot net
 Reported by:        spam2 at rhsoft dot net
 Summary:            file_get_contents() handles redirects wrong
 Status:             Open
 Type:               Bug
 Package:            Scripting Engine problem
 Operating System:   Linux
 PHP Version:        5.4.13
 Block user comment: N
 Private report:     N

 New Comment:

i know that, but it is not that easy to generate everytime a full qualified URL and since any other
http-client translates the ../ PHP should act the same way


Previous Comments:
------------------------------------------------------------------------
[2013-04-04 15:53:58] johannes@php.net

RFC 2616 Section 14.30 requires "a single absolute URI." for the location header. Any
relative location is not standards compliant.

------------------------------------------------------------------------
[2013-04-04 14:55:58] spam2 at rhsoft dot net

Description:
------------
[line "182"] [id "950103"] [msg "path traversal attack"] [data
"../"] [hostname "test.test.rh"] [uri
"/contentlounge/updateservice/cms_demo/cms//../cms.php"] [unique_id
"UV2MrQoAAGMAAE356XkAAAAF"]


in the folder /cms is a simple index.php with header('Location: ../cms.php');
every normal browser translates path and does not trigger modsec
php triggers the "path traversal"-rule


Expected result:
----------------
call the URL /contentlounge/updateservice/cms_demo/cms/cms.php

Actual result:
--------------
calling the URL /contentlounge/updateservice/cms_demo/cms//../cms.php


------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=64582&edit=1


Thread (5 messages)

« previous php.bugs (#178294) next »