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
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: ghopper at cox dot net
New email:
PHP Version: OS:

 

 [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-2021 The PHP Group
All rights reserved.
Last updated: Sat Sep 25 22:03:39 2021 UTC