6 ms·
How Not to Do Web Site User Registration
- pj 17y agoI think it is okay to email the user a new randomly generated password. There's not much difference between that and a link the user can click to create a new password. I suggest not putting the username and the password in the same email -- ever -- even if it is randomly generated. It actually may be better to send a random new password, rather than a link, because then the hacker needs to at least guess something, in this case, the username, so it may be more secure. For added security, you can make the random password (or the link if you want to do it that way) expire so the user has to be a bit prepared. That reduces the window for someone reading their emails to jump in and steal the account.
- jonknee 17y agoExcept that if you email a new password anyone can reset someone's password by only knowing the email. It can be a real pain. Imagine being on the customer support side when an unknown third party keeps resetting someone's password.
- pj 17y agoIn this case, you introduce the concept of the "secret question and answer." But then sometimes users forget those too. There is no perfect scheme, because there are no perfect memories...
- DougBTX 17y agoPerhaps no perfect scheme, but you can do better than provide a "lock someone out of their account if you know their username" button as described above.
- pj 17y agoWhat is a better method? I'm not disagreeing with you. I am encouraging you to share better ideas.
- jonknee 17y agoA better method is to send a special link to a user who requested to reset their password. After clicking on that link they can change it and log-in. That makes it such that the user is the only one that can trigger the reset. The worst a third party can do is trigger an email (simply note in the email that if you did not request the email to ignore it and that your account is still safe). This is a common technique.
- deleted 17y ago[deleted]
- nuclear_eclipse 17y agoWith the Mantis Bug Tracker, users can request a password reset based on username, but it does not prevent the user from continuing to login via the existing password if the user does not get/click on the password reset link from the email.
- pj 17y agoI like that idea.
- dinkumthinkum 17y agoThat's more of a DoS attack than a breach of security. You can detect mass password rests and determine if that is happening. However, in practice, I've never really heard of this happening (I'm sure someone will point me to some examples). But again, this is just another sort of DoS attack.
- sounddust 17y agoYou don't reset the user's password when he/she requests it via a web form. You send the user an e-mail with a cryptographically secure token (rather, a URL containing the token) that allows them to reset their password. You keep a table of valid tokens and expire them regularly. That will serve the same purpose without causing an inconvenience to the user.
- jonknee 17y agoSome people do reset the password when requested via a web form though, that's what I was replying to. For my own projects I do what you suggested.
- gommm 17y agoYes but you should make that random password a reset password that starts becoming valid only once used and sends the user directly to a new page where he can change his password
- trickjarrett 17y agoI highly doubt Wordpress.com is storing the passwords in a reversible encryption, or in plain text. It seems to me that when the user hits that page, the password is generated and displayed. Yes it should be https at the least, but aren't you going to go in and change the password immediately anyways?
- wysiwtf 17y agoI agree, the main issue here is that they're not using SSL during these steps, and the second is that they don't recommend changing your password from the generated default.
- pj 17y agoIf you look at the actual WP create account page here: http://en.wordpress.com/signup/ http://en.wordpress.com/signup/ You'll see that there is a box for your password and a confirmation of the password, so that leads me to believe that they are actually sending the user the password they created the account with, rather than a randomly generated one. Otherwise, why have the input fields there at all? Therefore, they must be storing either plain text or two-way encryption.
- TallGuyShort 17y agoWhich also suggests that these are passwords that most users use for other online accounts...
- deleted 17y ago[deleted]
- jellicle 17y agoSigh. Everyone has an opinion about website registration and password storage, and most of them have never actually administered a large website. Was your original signup https? No? Then the hypothetical attacker who is reading all the traffic on your connection already has your password. Would you happily login to your account from the WiFi at Starbucks, or from the public machine at the local library? Yes? Then the hypothetical attacker already has your password. Emailing passwords to new users is USEFUL. It undoubtedly saves Wordpress hundreds of support requests PER DAY. That is real money saved, and it must be balanced against the insignificant risk of being "hacked" by someone reading your email on the wire. ANY ability to reset a password via email is insecure. The email is plaintext; it must contain enough information for the recipient to get into his account; therefore, an attacker on the wire can get into the account. It doesn't matter how the password is stored or how the password reset is accomplished, it's equally insecure. There is NO SECURITY DOWNSIDE to emailing a user's password to them vs. having some multi-step reset procedure. An attacker which can read out the passwords from your database already owns your site. Finally, complaining about the activation key (which is a hexidecimal hash value) is insane. It's far more secure than any other passwords on the site at all. Finally finally, I think Wordpress does store passwords as one-way hashes, so most of this guy's argument is moot anyway.
- deleted 17y ago[deleted]
- sp332 17y ago"Would you happily login to your account from the WiFi at Starbucks, or from the public machine at the local library? Yes? Then the hypothetical attacker already has your password." This isn't true if the website uses https (since we're talking about sniffing, not man-in-the-middle).
- pj 17y agoEcrypted wireless connections also help. I'm always very cautious about the kind of wireless link I'm using. You have to be conscious on the internet, that's the moral here. I have stopped using websites that sent me my password in plain text, unless I just don't care about the account. If the developers aren't savvy enough to know how to protect their users, I lose confidence in them.
- robryan 17y agoWordpress defiantly encrypt there passwords in some unreversable format using a salt. I don't think SSL is really necessary for a community site like the wordpress one.
- icey 17y agoUgh. I wish there was some kind of voting undo. (I accidentally upvoted you.) First: I assume you mean that Wordpress _definitely_ encrypts their passwords, not defiantly. Second: What is your proof they they are hashing passwords, salted or not?
- diego 17y agoFrom the source code of Wordpress MU: // If the stored hash is longer than an MD5, presume the // new style phpass portable hash. if ( empty($wp_hasher) ) { require_once( ABSPATH . 'wp-includes/class-phpass.php'); // By default, use the portable hash from phpass $wp_hasher = new PasswordHash(8, TRUE); }
- aditya 17y agoHonestly, this is a classic usability vs security question. All the other suggestions (other than the over the top I'm flipping out because this is so insecure stuff) are ok, except for #5. Are you seriously telling me that there are hackers out there waiting to break into a blog that you might never edit? No. But, if you do forget your password, and they sent it to you in an email you can go back and look for it. Most people do. Web app security is a big deal, but not if what you're securing isn't worth the usability hit. EDIT: I wasn't talking about storing plain-text passwords in the db, but more about sending it via email to the user before you encrypt it and store it in the db.
- pj 17y agoIn this example, it was "just a blog" but there are serious sites that will email you your plain text password too. Verio stores two way encrypted passwords and domains are important to some people and they do get stolen and they are valuable, so this is a serious issue. Security is very difficult. You can't treat it glibly. Your users deserve more respect than that.
- aditya 17y agoSure, anything that has sensitive information about you needs to treat security as a priority. Most web apps (other than banks and people that store credit card data (not process)) are probably fine. right?
- pj 17y agoaditya, from a developer perspective, I cannot think of any reason to ever store recoverable passwords in a database. It's just too easy to do a one way hash. Okay, there is only one reason, if you are building a system that allows the storage of multiple accounts and passwords that are "re-used" like in some browsers' auto-complete feature. Then the concern is security of the local machine and if you use that technology, you're increasing your personal risk. In the scenario I mention there, it is absolutely imperative to use an advanced two-way encryption algorithm. In that case, the hacker will need to compromise the database and the code, which should be obfuscated as well so the decryption keys are more difficult to discover. There are some hackers who will always be able to hack you and some that will never be able to hack you. It's a probability game and you want to reduce the probability as much as possible that anyone will get in...
- run4yourlives 17y agoFor reference I give you: Reddit and their password losing debacle. (http://blog.moertel.com/articles/2006/12/15/never-store-passwords-in-a-database http://blog.moertel.com/articles/2006/12/15/never-store-pass...)
- snorkel 17y agoAm I only one not too concerned about the Chinese hackers stealing my WordPress support forums password then posting WordPress support questions using my login credentials? It's almost a nuisance that a support forum requires you to create a user account at all!
- theBobMcCormick 17y agoThere's no two ways about it. If you don't take reasonable care with your users sensitive data, especially things like passwords, security questions, credit card information, etc. then you are an completely incompetent unprofessional hack and also a creep, a jerk, and a generally miserable person to boot. That means you don't store passwords in an unhashed format (plaintext or encrypted). You don't store credit cards at all unless you've can't find any other design options. And if you do store them, you take great pains to meet or exceed reasonable standards (like PCI) for storing them safely and properly. This is vastly more important than what language or framework you use. Vastly more important than whether you use CCS or tables. Vastly more important than whether you use a SQL database or a hip new RESTFUL key-value store. This is about trust. This is about integrity. This is about professionalism. Are you trustworthy? Are you a professional? Then do the right thing damn it!
- guns 17y agoas pointed out in the article comments: site:en.wordpress.com "your account is now active"
- democracy 17y agoThe whole thing reminds me of that old joke when you encrypt/cypher/code the beast, but the user will still put it on sticknote on his monitor.