|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45997 safe_mode bypass
Submitted: 2008-09-04 19:03 UTC Modified: 2009-04-30 15:27 UTC
Avg. Score:4.4 ± 1.4
Reproduced:5 of 7 (71.4%)
Same Version:5 (100.0%)
Same OS:5 (100.0%)
From: johannesdahse at gmx dot de Assigned: pajoye (profile)
Status: Closed Package: Safe Mode/open_basedir
PHP Version: 5.2.6 OS: win32 only
Private report: No CVE-ID: None
 [2008-09-04 19:03 UTC] johannesdahse at gmx dot de
safe_mode bypass with a preceding backslash. tested with exec(), system() and passthru(). on windows only.

Sorry, I do feel this bug concerns a security issue but I got no response from after sending 2 emails from 2 different accounts about 6 weeks ago.

Reproduce code:
on commandline:
php -n -d safe_mode=on -r "exec('\ping');"

with PHP script and enabled safe_mode in php.ini:
<? exec('\ping'); ?>

Expected result:
safe_mode turned on should block code execution from exec() and other functions.

Actual result:
By adding a backslash infront of the command the command got  executed anyhow.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2009-04-30 15:27 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Jul 20 03:02:00 2024 UTC