[Owasp-alabama] using SESSION Vars to store sensitive data...

owasp-alabama at lists.owasp.org owasp-alabama at lists.owasp.org
Tue Jun 21 12:58:47 EDT 2011


Ok all, here it goes...

i have a large enterprise product im working on, it has been in production for some time...  they now want me to add LDAP (AD via LDAP) authentication support...

- The app is PHP . . . ok ok lets keep the rhetoric down ;-)
- It must run on any web server that supports PHP, and yes all functions should work from any hosted OS
- Backend is Mysql, (but thats not really relevant...)

Im using ADLDAP.php, seems to be fairly solid... ---> http://adldap.sourceforge.net/

i can authenticate fine from any hosted OS, all is great there...

here's the problem..

i often have to go back to the ldap server during the course of setup to get different values, to do this i need to re-authenticate with the LDAP server on every request... so this means the user could have to enter the credentials multiple times... that sucks...

the only solution is to store the user / pass the first time they enter it somewhere, so i can grab it and resend to LDAP when i need it...  

so where to store it?

- i dont want to store them anywhere permanent of course
- i only need it for the existing session
- it really only important when the admin is changing stuff for users or ldap config.
- i cant use a one way hash, cause i need to send it to another server... 
- i could do some sort of obfuscation, but is that really secure? better than nothing?

Options
- Session Var certainly an option... but other than the obvious session file on the server are there other risks?

- i could store it in the DB, but then thats seems more risky than the session because there are more points of access..

- an obvious one is to pull all the data from LDAP on the first login and stuff that in a session, but on large LDAP it will slow user login time down... non-starter...

of course regular session security needs to be optimal...


IDEAS or COMMENTS?  I can handle flames as long as they are intelligent... :-)

Chris


More information about the Owasp-alabama mailing list