Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Re: Accessing Authenticated User's Password From CGI

by enoch (Chaplain)
on Feb 10, 2003 at 23:17 UTC ( #234273=note: print w/ replies, xml ) Need Help??


in reply to Re: Accessing Authenticated User's Password From CGI
in thread Accessing Authenticated User's Password From CGI

I was thinking something more like a variable accessible just from Perl. Something no different than using a PerlAccessHandler with mod_perl a la:

sub authen_handler { my $r = shift; # get user's authentication credentials my ($res, $password) = $r->get_basic_auth_pw; return $res if $res != OK; my $user = $r->connection->user; # authenticate through DBI my $reason = authen_dbi($r, $user, $sent_pw); if ($reason) { $r->note_basic_auth_failure; $r->log_reason($reason, $r->uri); return AUTH_REQUIRED; } return OK; }
I am not sure I understand how setting an environment variable would make a network insecure even if the variable is a user's password. If the password is sent over SSL and only accessible from the Perl CGI that accessed it, what insecurities would result?

enoch


Comment on Re: Re: Accessing Authenticated User's Password From CGI
Download Code
Re: Re: Re: Accessing Authenticated User's Password From CGI
by simon.proctor (Vicar) on Feb 10, 2003 at 23:41 UTC
    If I have made any mistakes or erroneous assumptions here please tell me! :)

    To be fair the context of your intitial request hinted more at your wanting to look at the network credentials of the authenticated user. At least thats how I saw that.

    However, regardless of first impression, you should look at this from a different angle. Consider yourself as the user of your application/network.

    You want the confidence that once authenticated, your password is not used or transmitted again unless specifically actioned by yourself. Your password is direct access to your identity so you want the finest control over it you can have.

    The environment you refer to comes from the server. The server doesn't magic this up but receives these variables from the context of where and how it is running. For it to create the password environement variable for your program it must have first received that information in some form.

    Now this would have to come with every single request from the client regardless of whether you are using mod perl or not. That would mean that the clients password would be transmitted over the network each time it did something.

    Now you should clearly see why that is dangerous.

    If you are wanting to stick with network security as your methodology (which is what you originally implied) then you have to trust to the security of that network.

    However, you have a separate context of the user implicity providing their authentication details. In that instance then you have already been given the advice you need on how to implement this. You must bear in mind, though, that this will ultimately be a different set of data to that of the network authentication data (though some users will be naughty and use the same usernames/passwords).

    HTH

    SP

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://234273]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2014-07-29 23:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (229 votes), past polls