Re: php vs. apache login verification security?
From: Fred H (secret_at_nospam.com)
Date: 02/26/04
- Next message: Fred H: "Re: how to echo time and date?"
- Previous message: Fred H: "Re: php vs. apache login verification security?"
- In reply to: cool: "Re: php vs. apache login verification security?"
- Next in thread: J.O. Aho: "Re: php vs. apache login verification security?"
- Reply: J.O. Aho: "Re: php vs. apache login verification security?"
- Reply: coolsti: "Re: php vs. apache login verification security?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 26 Feb 2004 08:39:57 GMT
> I am doing it now by including a function call in each and every page
> which
> calls the php start session function and then after that checks to see if
> the user is logged in. If not, the user is redirected to the log in page.
You could consider to put all pages into one, with a common "top", that
does
all auth stuff, and other common things (?), and then a "require" part that
loads the page the user wants to see. You then of course have to have a
variable
calles "show" or something similar, to select which page you wish to
display.
This would make it easier to maintain the auth and other global routines
you
wish to deploy.
> I know that session info is stored by php in a file on the server, and I
> don't think much of it is stored in cookies. I think PHP just puts info
> into the cookie to allow for session identification. I am thinking here
> of
> your warning of what not to store in a cookie. Can you add anything here
> that I should watch out for or check?
Hm, I don't know. The hashing of username and password is -only- to prevent
cookie snatching. Network sniffing would still get the it all. So you could
consider to use some kind of secure channel between the user and the host,
using "https://". Your webserver need to support this though.
Also, if security is vital to your solution, you should investigate if
there
are schemes that can be deployed to fool your auth system. But don't put
more
into it that it's worth. So the first question you need to answer is,
exactly
what can happen if a "malicious hacker" gets passed your auth scheme.
And here are some random thoughts and ideas for you project:
- Configuration for different timeouts based on:
-- 1: IP-ranges. Longer timeout for your company's IPs.
-- 2: A "I'm at a public PC" setting, like Hotmail had/has. Shorter
timeout.
- You probably got this allready, but: "Log off" functionality.
- Make sure your page "wash" incoming variables! It's a good idea to not
only wash them, but also store them into some data structure, and unset
the global vars like $HTTP_POST_VARS and so on...
- Complete blocking based on IP-ranges you *know* your users wont connect
from.
Here are some other random thoughts:
Allways request confirmations for actions that may be harmfull or that
changes
any settings. This is to prevent highjacking of sessions by spoofing a
logged
in users IP-address. This can be for example be done if you don't use
cookied,
and the session id is part of the query string. Then anyone can read it
over
the user shoulder, and may then send spoofed requests to the server. This
also
suggests that you -should- use cookies, in addition to session ids. But a
good
idea would be to store something along the lines of a md5 sum of the
concatenation
of the username and the session id as the username, and likewise for the
pwd.
This is to prevent a "session cookie" to be reused later.
The more I think about it, the more you need a secure connection. Because
unless
you have, there's allways the chance that someone sniffs the users
username and
password. And since you mentioned internet cafes as a possible place to
log in
from, there isn't much you can do to prevent someone from sniffing. Not
all public
LANs are switched all the way to the end computer...
You could of course start using javascript, and fancy auth protocols, and
javascript
encryption. But that's just asking for trouble. Using "https://" is much
easier.
Good luck.
Fred, Norway.
--
Fred H
void FredH::Contact() {
TextToSpeach.say("frode at age dee dee dot en oh");
}
- Next message: Fred H: "Re: how to echo time and date?"
- Previous message: Fred H: "Re: php vs. apache login verification security?"
- In reply to: cool: "Re: php vs. apache login verification security?"
- Next in thread: J.O. Aho: "Re: php vs. apache login verification security?"
- Reply: J.O. Aho: "Re: php vs. apache login verification security?"
- Reply: coolsti: "Re: php vs. apache login verification security?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|