php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #17156 readfile can bypass safe_mode
Submitted: 2002-05-11 15:22 UTC Modified: 2002-05-11 16:00 UTC
From: ilia at prohost dot org Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.2.0 OS: Linux 2.4.18
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: ilia at prohost dot org
New email:
PHP Version: OS:

 

 [2002-05-11 15:22 UTC] ilia at prohost dot org
If a readfile() function is passed 2nd parameter it can be used to read ANY file on the system regardless of safe_mode.

ex.

<?php
readfile('/etc/passwd', 1);
?>

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-05-11 16:00 UTC] rasmus@php.net
Fixed in CVS (for all functions with a safemode_include_dir switch).  Note that this was only a problem if the safemode_include_dir was not defined in the php.ini file.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Dec 06 12:00:01 2025 UTC