|  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
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.
Block user comment
Status: Assign to:
Bug Type:
New email:
PHP Version: OS:


 [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: Mon Aug 08 10:05:45 2022 UTC