Software Development

Verifying Secure Password Storage Externally

Many websites (including big ones like Adobe, Yahoo, LinkedIn, Gawker, etc.) store user passwords insecurely. Either in plain text, or encrypted (reversible), or using a broken or brute-forceable hash function. Many websites continue to be built with poor password storage mechanism.

So what? Well, if the database leaks somehow (and it obviously happens, see the link above), then users are in trouble – not only their accounts on the problematic site is compromised – many of their accounts around the web may be compromised, because of the natural tendency of users to reuse passwords. So if your site is broken, it’s not only about you – it’s about your users’ other accounts, and that alone means the matter is very serious.

We know how to implement it, yes – use bcrypt/PBKDF2/scrypt. We know, but many people don’t. So I thought it may be good to give good websites a way to prove to their users that they take the password issue seriously.

So I created SaltedHashed.com (as a weekend project). It requires website owners to expose their password-storing mechanism as a REST-like API endpoint, which my service invokes periodically to check if everything is ok. The invocation consists of a random-generated password, and the website must respond with the algorithm it uses, together with the final form of the password that is stored in the database.

After the process is successful, the site gets a badge (like those “Valid XHTML”, “Valid CSS”, “Secured by VeriSign”, etc. badges that we (used to) have) which says “We store passwords securely” and links to a page that gets the up-to-date status of the site and explains the user why this is important. It’s not much, I know, but it has the tiny chance of raising awareness of the issue, and that’s important.

The only algorithms that are recognized as secure are Bcrypt, PBKDF2 and Scrypt. SHA-512 isn’t. No simple hashing function is. Encryption is not allowed (because it is reversible, and if the attacker gets ahold of your key, all the passwords are revealed).

The solution is not bullet-proof – someone might expose a dummy Bcrypt endpoint, while still using plain-text passwords, but as noted in the docs – why would you not use functionality that you’ve already implemented for the sake of being “compliant”? In general, I think the effort on the side of developers, in order to expose the endpoint, is minimal.

The project is on GitHub. It’s written in Java, with Spring MVC. MongoDB is used as a database. It is currently deployed on OpenShift (RedHat’s PaaS) mainly because it’s easy to setup and is free. (Note: I obviously need a better designer to at least fix the badge and make the site less ugly, even though Bootstrap minimizes the change for a developer like me to make a really ugly thing). Authentication on saltedhashed.com is done only via Mozilla Persona – 3rd party authentication which doesn’t require storing passwords on my end (something I’d actually recommend to all websites).

I’m trying to address a small, but important problem. I hope I’m helping improve the situation at least a little.
 

Reference: Verifying Secure Password Storage Externally from our JCG partner Bozhidar Bozhanov at the Bozho’s tech blog blog.

Bozhidar Bozhanov

Senior Java developer, one of the top stackoverflow users, fluent with Java and Java technology stacks - Spring, JPA, JavaEE, as well as Android, Scala and any framework you throw at him. creator of Computoser - an algorithmic music composer. Worked on telecom projects, e-government and large-scale online recruitment and navigation platforms.
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Back to top button