Bug #15818 Updated: escapeshellarg does not escape characters for win32
| From: | sniper@php.net | Date: | Mon, 08 Jul 2002 00:55:26 +0000 |
| Subject: | Bug #15818 Updated: escapeshellarg does not escape characters for win32 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-13441@lists.php.net to get a copy of this message | ||
ID: 15818
Updated by: sniper@php.net
Reported By: ghopper@cox.net
-Status: Open
+Status: Feedback
-Bug Type: Unknown/Other Function
+Bug Type: Program Execution
Operating System: Win2k
PHP Version: 4.1.1
New Comment:
Thank you for taking the time to report a problem with PHP.
Unfortunately your are not using a current version of PHP --
the problem might already be fixed. Please download a new
PHP version from http://www.php.net/downloads.php
If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.
Previous Comments:
------------------------------------------------------------------------
[2002-03-01 12:46:19] ghopper@cox.net
Windows NT 5.0 build 2195
Microsoft-IIS/5.0
php version 4.1.1 (the binary zip package for win32)
php is running cgi-mode (php.exe)
example script:
$arg = "junk && start cmd junk";
$arg = escapeshellarg($arg);
system("anycommand $arg",$output);
This starts a command shell running as the web server process. This
could be used as an exploit if the contents of $arg come from a form.
This also works with system(escapeshellcmd("anycommand $arg"));
As a suggestion, you might want to create a command to
"removeshellchars" instead of just quoting them.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=15818&edit=1