|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Sec Bug #69768 escapeshell*() doesn't cater to !
Submitted: 2015-06-07 18:01 UTC Modified: 2015-07-10 14:45 UTC
From: Assigned: cmb (profile)
Status: Closed Package: Program Execution
PHP Version: 5.6.9 OS: Windows
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 !
Your email address:
Solve the problem:
50 + 47 = ?
Subscribe to this entry?

 [2015-06-07 18:01 UTC]
When delayed variable substitution is enabled (can be set in the
Registry, for instance), !ENV! works similar to %ENV%, and the
value of the environment variable ENV will be subsituted.

Neither escapeshellcmd() nor escapeshellarg() handle ! as a
special character, so this can cause security issues.

I suggest to treat ! the same as %, i.e. escape it with ^ in
escapeshellcmd() and replace it with a space in escapeshellarg(),
like it's done in the attached patch.


escapeshell-exclamation-mark (last revision 2015-06-07 18:02 UTC by

Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2015-06-07 18:02 UTC]
The following patch has been added/updated:

Patch Name: escapeshell-exclamation-mark
Revision:   1433700149
 [2015-06-22 10:43 UTC]
-Status: Open +Status: Assigned -Assigned To: +Assigned To: cmb
 [2015-06-22 10:43 UTC]
Seems fine to me, go ahead and commit it, should probably go all the way down to 5.4
 [2015-06-23 23:47 UTC]
-Status: Assigned +Status: Closed
 [2015-06-23 23:47 UTC]
Merged into 5.4, 5.5, 5.6 and master.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Thu Aug 18 05:04:04 2022 UTC