I am just beginning design of a site and had a quick question about authentication. The submission of id/password using the standard technique shown is pretty straightforward but is it secure or is this passing the pw as cleartext across the wire and this page should be https?
Any help would be appreciated, I would like the site to be secure.
Mark
Thzat’s still a HUGE amount of extra JavaScript code needed just to provide that second key to the lock just to add slight protection for if the person stupidly used the same password elsewhere (and if they don’t have JavaScript enabled or disable it for pages that contain humungous JavaScripts as this one would then they are back to sending the plain text version anyway. Also since they are intercepting all of what you send from your browser they’ll collect the other passwords when you send them anyway.
There is a very simple and very secure way to send passwords from the browser to the server where you decide that you need it and it can be applied to ANY site without needing much in the way of code changes. It’s called HTTPS. That is specifically what HTTPS is for - as well as being the only way to do it.
If you want to secure something being sent from the browser to the server you use the right tool for the job - HTTPS and not the wrong tool (eg. a horse, a hammer, JavaScript, or oranges)
In the database yes but that isn’t what this thread is about. This thread is discussing how to secure the password between the browser and the server and the only way to do that is to use HTTPS.
The second most secure way for when HTTPS isn’t available is as plain text since that way there is only one possible value that will work for the password. It is vulnerable to a man-in-the-middle attack but then so is ANY method that doesn’t use HTTPS.
Using JavaScript to hash the password before sending it means that the server needs to be able to accept both the plain text AND has versions in case JavaScript is disabled. This makes it twice as easy for someone to crack the password since there are now two values that will work instead of one and a man-in-the-middle attack will retrieve whichever of the two is used and they’ll be able to use that to break in whether you hashed the password or not.
Sounds like vBulletin need to improve their password security by getting rid of the hash versions of passwords so as to reduce the number of values that will work for the password for someone trying to break in.
It’s called the Man-in-the-middle attack. I don’t know how you would perform that attack over HTTP but I’m pretty sure it’s possible. If I did know how it worked I wouldn’t explain it either; wouldn’t want people to get ideas
I would advise against doing that as all it means is that there are now two versions of the password that will work to break into the account instead of one and the two versions are still being sent in plain text (depending on whether JavaScript is or isn’t available) even though one is a SHA-256 of the other.
Anything you do with JavaScript weakens the security.
Yup, the method described here is prone to the replay attack.
I’ve outlined a method in another thread that doesn’t suffer from this (but has it’s own drawbacks, obviously using SSL is the only way to get it completely safe).
If HTTPS isn’t available (although HTTPS is the best option from a security standpoint), you can hash the password upon submission. I’d suggest a javascript implementation of SHA-256.
The hash would be sent in plain text, but the user’s actual password would not.
You might also want to salt as well as hash the password to make it a little more secure.
Note that if javascript is disabled in the browser, you’re back to sending the password in plain text.
It does and it doesn’t. If the real plain text password is intercepted on it’s way the attacker might be able to use the same password for a dozen other sites and email accounts too, and they get an insight into your password naming pattern.
If they intercept a hash they can still access the site in question, but won’t get so many clues to help them break into other accounts.
On normal http request a post variable is sent plain text. but could anyone give me a real example about how could somebody intercept this variable? I know, is a noob question but i cannot imagine any scenario
Yes, that’s the most secure way to do it if SSL isn’t available since any alternative just makes it easier to crack by providing alternative values that will also work if captured.