Re: hiding passwd in cmdlines that appear in the process list
| From: | tg-php at gryffyndevelopment dot com | Date: | Mon, 04 Dec 2006 14:40:21 +0000 |
| Subject: | Re: hiding passwd in cmdlines that appear in the process list | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-245479@lists.php.net to get a copy of this message | ||
You'd assume those ENV variables are secure.. or secure "enough". I know
there's no such thing as perfect security, but I still wonder if there's a better way.
Although at this point, if there was a way to read other process/subprocess ENV variables, it'd
most likely be something an attacker would have to get at by being fairly close to the system
(trojan installed as root and exploiting an OS bug that allowed access to ENV variables from other
processes for example). So I'm guessing this is about as secure as you're going to get
for now.
The problem still bugs me though.. hah.
-TG
= = = Original message = = =
tg-php@gryffyndevelopment.com wrote:
> If you did use ENV to set the username and password, you could always unset it using the same
> method after you ran the mysql command. So it'd only be exposed for a very brief period of
> time and slightly less accessible than just running a process list.
>
indeed I do the following directly after the relevant call to exec() :
putenv('MYSQL_PLESK_PWD=doreallythinkIwouldleavethispwdfloatingaroundinashellenv?');
> It still falls under the category of "security through obscurity" which isn't a
> best practice scenario. But I can't think of another way to run mysql under these
> circumstances that's any better.
but given that the ENV var is only available to the shell php in currently running in (and any
subshells) so
the script is only vulnerable to mistakes/attacks from 'inside' the script - basically
I'm assuming that
whatever is stored in the ENV of a shell is not accessible/visible to other users on the given
system.
is that assumption correct?
>
> -TG
___________________________________________________________
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.