note 88519 deleted from session.security by salathe
| From: | salathe@php.net | Date: | Mon, 21 Sep 2020 14:46:30 +0000 |
| Subject: | note 88519 deleted from session.security by salathe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-215301@lists.php.net to get a copy of this message | ||
Note Submitter: bmearns at ieee dot org
----
In addition to ip-address binding not always being effective, it can also prevent users connecting
through a proxy-pool from even being able to use your site. In such a scenario, a person's IP
address may very well change with every access.
If you're handling anything remotely secure, the only safe option is HTTPS. If the data
doesn't need to be that secure, than you should not allow a high-jacked session to do too much
damage. Basically, don't assume that a person really is who they pretend to be just because the
session says a person authenticated with a username and password: it may have been that person who
logged in, but that doesn't mean it's still that person. So if you're going to do
something like change passwords or something, require them to authenticate again on the same form.
Of course this needs to be done in some secure way, as well, so that the password is not just
floating over the network. A good way to do this is sending a nonce (number-used-once) along with
the form and some javascript to concatenate the nonce to the password, then perform a cryptographic
hash of the combined string. The resulting valid-once "password" should then be sent
instead of the plain text password. To be effective, you also need to prevent people from using the
form if they don't have JavaScript enabled. You can do this by disabling the form fields in
HTML, then re-enabling them in JavaScript.