php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15818 escapeshellarg does not escape characters for win32
Submitted: 2002-03-01 12:46 UTC Modified: 2002-08-09 01:00 UTC
From: ghopper at cox dot net Assigned:
Status: No Feedback Package: Program Execution
PHP Version: 4.1.1 OS: Win2k
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
40 - 13 = ?
Subscribe to this entry?

 
 [2002-03-01 12:46 UTC] ghopper at cox dot 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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-07-07 20:55 UTC] sniper@php.net
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.


 [2002-08-09 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 19:01:29 2024 UTC