safe_shell_exec extension for consideration

[email protected] (Dave McMurtrie) Sun, 23 May 2010 17:42:15 -0400
Newsgroups php.pecl.dev
Message-ID <[email protected]>
Hi,

We're working to deploy an application using PHP and we'd ultimately 
like to be able to fork/exec a child process without ever involving a 
shell for the purpose of limiting our exposure to potential shell 
vulnerabilities.

I noticed that shell_exec(), popen() and proc_open() all involve a 
shell, so I wrote a quick extension that will do essentially what 
shell_exec() and popen() do, but doesn't involve ever forking/execing a 
shell.

I don't know if others might find this useful or not, so I'm sending 
this note for consideration to have it added as an extension.  If 
there's a better way to do what we're interested in, please let me know. 
  If any code changes are required to allow this to be contributed, 
please let me know.  If this is something you're simply not interested 
it, also let me know.

At the very least, I suspect my tokenizer would require some additional 
functionality, though it does what we currently need.

You can download a tar/gz copy of the extension at:

http://www.andrew.cmu.edu/user/dave64/safe_shell_exec.tar.gz

Thank you,

Dave