News for hackers. Stuff that matters.
Re:Yahoo discloses hack of 1B accounts by duaneb on Wednesday December 14, 2016 @06:50PM (#13180911)
Gonna guess that's a bad message for a password length violation or something else.

Not that it's much better. Is it so hard to allow 50 character passwords?

Re:Yahoo discloses hack of 1B accounts by bagacrap on Wednesday December 14, 2016 @07:34PM (#13181195)
I'm guessing it detected an @ symbol?
Re:Yahoo discloses hack of 1B accounts by divanvisagie on Thursday December 15, 2016 @12:07AM (#13182583)
has anyone tried password@password ?
Re:Yahoo discloses hack of 1B accounts by AsyncAwait on Wednesday December 14, 2016 @08:16PM (#13181459)
if the password is stored properly, (i.e. bcrypt), the number of characters shouldn't matter at all, be it 50 or 5000.
Re:Yahoo discloses hack of 1B accounts by sk5t on Wednesday December 14, 2016 @08:28PM (#13181541)
It sort of does matter for bcrypt, surprisingly: http://security.stackexchange.com/questions/39849/does-bcryp...

In the interests of hewing closest to cryptographic reality, I design not to allow a password longer than the algorithm can usefully use.

Re:Yahoo discloses hack of 1B accounts by dlubarov on Wednesday December 14, 2016 @09:23PM (#13181829)
I think it's best to allow longer passwords for those who use long phrases. It's easier to remember the full phrase than a truncated version. You could show a warning that the extra chars beyond 50-55 will be ignored.
Re:Yahoo discloses hack of 1B accounts by kijin on Thursday December 15, 2016 @12:02AM (#13182564)
Or you could SHA256 the original password and feed the hash to bcrypt. Remember to use the 64-byte hexadecimal hash, not the 32-byte binary because bcrypt chokes on null bytes.

Everyone's been saying "just use bcrypt", but bcrypt has too many gotchas to be the default choice. We really need to work on getting scrypt and argon2 into the most popular programming languages and frameworks a.s.a.p.

Re:Yahoo discloses hack of 1B accounts by blowski on Thursday December 15, 2016 @04:29AM (#13183432)
> Everyone's been saying "just use bcrypt", but bcrypt has too many gotchas to be the default choice

This has got to be the underlying problem of modern security. By the time a best practice is well known, it's no longer best practice.

Re:Yahoo discloses hack of 1B accounts by dajohnson89 on Thursday December 15, 2016 @10:14AM (#13185094)
I think that's a good observation. The implication seems to be that we're not iterating fast enough, or not sufficiently fast in implementing changes/improvements.

On the flipside, isn't there a risk of moving too quickly? There's a certain culture of caution because there's something to be said for "if it aint broke, don't fix it." and even if something is broke, how certain are we that cool new encryption algorithm is better or safer?

Re:Yahoo discloses hack of 1B accounts by kaeluka on Friday December 16, 2016 @03:52AM (#13191974)
Like nutrition!
Re:Yahoo discloses hack of 1B accounts by paulmd on Thursday December 15, 2016 @11:50AM (#13185940)
You would probably want to use PBKDF2 as a key-stretching function rather than just naive SHA256. Otherwise you're clipping your bcrypt input from "56 arbitrary bytes" down to "56 hexadecimal characters".

I haven't looked deeply at this, but using "key stretching" that clips your output characters to such a small space smells very suspect to me.

Remember: there is only 32 bytes of actual output there, regardless of whether you represent it as hex or binary. And since bcrypt can't take more than 56 bytes of input, you are clipping that down to the equivalent of 23 bytes.

Re:Yahoo discloses hack of 1B accounts by bschwindHN on Thursday December 15, 2016 @02:15AM (#13183014)
Is "just use scrypt" an acceptable answer then? I'm not a security expert and I don't know the advantages of one over the other.
Re:Yahoo discloses hack of 1B accounts by amenghra on Thursday December 15, 2016 @04:08AM (#13183375)
Yes, scrypt is a perfectly fine password hash.

If you are currently using something else (say salted md5 or even just plain md5), you can migrate your passwords to scrpyt(current_hash()) without having to change everyone's password and/or wait for everyone to log in.

See also this comment thread: https://news.ycombinator.com/item?id=12549110

Re:Yahoo discloses hack of 1B accounts by aaronbasssett on Thursday December 15, 2016 @05:16AM (#13183594)
Don't do that. You've essentially just turned the old hashes into plain-text passwords, and how sure are you that those hashes don't exist in backups anywhere?
Re:Yahoo discloses hack of 1B accounts by rietta on Thursday December 15, 2016 @08:34AM (#13184437)
No, not exactly. An adversary who has the old hash, but not the plaintext that it represents cannot login because scrypt(H(H(value))) != scrypt(H(value)). This is not considering the offline crackability of a compromised hash. But there are legitimate situations where upgrading the password backing to a modern slow hash is preferable to continuing to use the old hash or worse storing the old hash as a field for a long time so that when a breach happens both the new and old hashes are available.

There are user experience battles when talking about forcing a million users to change their passwords in a real system. Hashing the hash may be vastly preferable to management nixing the security upgrade. A password updating schema that changes the hash as users login and eventually locking the accounts of users who have not logged in for an extended period of time can accomplish rolling the hashes without having to tell users to change their passwords.

Re:Yahoo discloses hack of 1B accounts by StavrosK on Thursday December 15, 2016 @06:34AM (#13183885)
Not if you mark the converted versions and try scrypt(oldhash()) on users authenticating with them.
Re:Yahoo discloses hack of 1B accounts by fractal618 on Thursday December 15, 2016 @06:37AM (#13183892)
Woah! Very good point!
Re:Yahoo discloses hack of 1B accounts by kijin on Thursday December 15, 2016 @05:33AM (#13183649)
scrypt is okay if you use it correctly. It's too easy to use it incorrectly, though, because scrypt is a low-level algorithm that wasn't specifically designed for password storage. [1]

http://blog.ircmaxell.com/2014/03/why-i-dont-recommend-scryp...

In order to be able to tell people to "just use scrypt", we would need to have a sort of standard wrapper that uses the correct parameters by default and produces identical results in every common programming language.

Re:Yahoo discloses hack of 1B accounts by zeveb on Thursday December 15, 2016 @04:32AM (#13183450)
> You could show a warning that the extra chars beyond 50-55 will be ignored.

Or you could use a better KDF, e.g. scrypt (even PBKDF2 is better on this metric). Artificial password-length restrictions are symptomatic of poor design.

Re:Yahoo discloses hack of 1B accounts by baby on Wednesday December 14, 2016 @09:54PM (#13181993)
This is surprising, do you know how Argon2 behaves compared to this?
Re:Yahoo discloses hack of 1B accounts by pjscott on Wednesday December 14, 2016 @11:59PM (#13182554)
Argon2 does the right thing. No silly upper bounds.
Re:Yahoo discloses hack of 1B accounts by KMag on Thursday December 15, 2016 @09:34AM (#13184766)
That depends on how silly you consider 2^32 - 1 bytes, if I recall correctly.
Re:Yahoo discloses hack of 1B accounts by Dylan16807 on Thursday December 15, 2016 @06:43AM (#13183918)
That's just a bug. Truncation invalidates the 'stored properly' part of the statement.
Re:Yahoo discloses hack of 1B accounts by mannykannot on Thursday December 15, 2016 @07:30AM (#13184112)
Could you expand on that? I did not think bcrypt was responsible for storing the resultant hash. The limit appears to be in calculating the hash.
Re:Yahoo discloses hack of 1B accounts by Dylan16807 on Thursday December 15, 2016 @02:09PM (#13187221)
The original phrasing was "stored properly, (i.e. bcrypt)". That's including the hashing as part of the 'storing'. Bcrypt has a size limit, but a size limit is not the same thing as truncating. It's broken code on the front end that truncates instead of doing something like sha512.
Re:Yahoo discloses hack of 1B accounts by sk5t on Thursday December 15, 2016 @11:06AM (#13185508)
Bcrypt spits out a string, that the caller must store, somewhere. I presume the parent post means that Bcrypt "stores" in its output string a value that, for all practical purposes, varies reliably with the same salt but different plaintext.
Re:Yahoo discloses hack of 1B accounts by drodgers on Wednesday December 14, 2016 @08:19PM (#13181480)
If the password is stored properly, (i.e. bcrypt) then there does need to be some length limit or it becomes too easy to DoS a service by sending it hundreds of megabytes of password to bcrypt. There's no reason for that length limit to be less than 100 characters though.
Re:Yahoo discloses hack of 1B accounts by dogma1138 on Wednesday December 14, 2016 @08:26PM (#13181527)
You are going to be limited by the max http request size way before that.

To upload 100s or even more than a few megs you need a multipart message, a password form won't accept MP http requests.

Re:Yahoo discloses hack of 1B accounts by patates on Thursday December 15, 2016 @04:13AM (#13183393)
On the back-end there usually is a naive POST handler which happily accepts anything it can parse, unless a mature framework with sane defaults is used.
Re:Yahoo discloses hack of 1B accounts by cookiecaper on Wednesday December 14, 2016 @08:57PM (#13181703)
Yep, people who've run marginally popular sites have dealt with this before. Give someone a text box and watch them try to stuff 4GB of content in it. There has to be a cutoff somewhere, but as you note, it should be well outside of the realm of reasonable password lengths (hundreds of characters).
Re:Yahoo discloses hack of 1B accounts by jsjohnst on Wednesday December 14, 2016 @09:11PM (#13181761)
GitHub is the only website I can think of off the top of my head that doesn't limit to an arbitrarily small number (aka <100). Do you name any other "major" websites that allow 100 character passwords?
Re:Yahoo discloses hack of 1B accounts by snowpanda on Thursday December 15, 2016 @01:45AM (#13182914)
Re:Yahoo discloses hack of 1B accounts by amichal on Thursday December 15, 2016 @12:21PM (#13186248)
Anything built with the popular rails gem devise allows 128 by default [1]

https://github.com/plataformatec/devise/blob/88724e10adaf9ff...

Re:Yahoo discloses hack of 1B accounts by XorNot on Wednesday December 14, 2016 @11:09PM (#13182325)
Hash the password locally (you are serving JavaScript over SSL right?) and only send the SHA256.
Re:Yahoo discloses hack of 1B accounts by zeveb on Thursday December 15, 2016 @04:34AM (#13183454)
That would lock out anyone who chooses not to execute your JavaScript.

Requiring me to trust your code in order for you to decide whether or not to trust me is asking too much.

Re:Yahoo discloses hack of 1B accounts by 0xfeba on Thursday December 15, 2016 @09:10AM (#13184621)
How would you know that the hash is of a password of sufficient entropy?
Re:Yahoo discloses hack of 1B accounts by jensvdh on Thursday December 15, 2016 @12:43AM (#13182716)
Never trust the client.
Re:Yahoo discloses hack of 1B accounts by XorNot on Thursday December 15, 2016 @01:40AM (#13182891)
This isn't about trusting the client: it's about your endpoint being able to only accept a SHA256 hash sum from the client (thus: length limited) while allowing the user to input arbitrarily long passwords.

They hash in the browser: the only way they can mess with it by producing silly outputs, but that only hurts them.

Re:Yahoo discloses hack of 1B accounts by libeclipse on Thursday December 15, 2016 @04:08AM (#13183376)
I can't think of any security implications of hashing on the client-side. What's your thinking?
Re:Yahoo discloses hack of 1B accounts by fnordsensei on Thursday December 15, 2016 @05:26AM (#13183625)
Does salting work if you hash in the browser?
Re:Yahoo discloses hack of 1B accounts by libeclipse on Thursday December 15, 2016 @05:36AM (#13183664)
Well in this case the hash would be passed to Bcrypt or Scrypt, which have built in salt support, so client side salting wouldn't matter.
Re:Yahoo discloses hack of 1B accounts by shawnz on Thursday December 15, 2016 @09:30AM (#13184729)
If the hashes are leaked, you could log in with them.
Re:Yahoo discloses hack of 1B accounts by XorNot on Thursday December 15, 2016 @07:43PM (#13190122)
Well serverside you store them as plaintext equivalents - i.e. salt+hash the hash. So a leak doesn't leak the user-side.
Re:Yahoo discloses hack of 1B accounts by chrischen on Thursday December 15, 2016 @04:25AM (#13183425)
It's probably a naive substring detection check.