News for hackers. Stuff that matters.
Re:Why you shoud never use your favorite password on News.YC... by cperciva on Saturday May 31, 2008 @05:35PM (#205438)
Of course the password is in plaintext. Logins are done via HTTP, not via HTTPS. You know, there isn't that little yellow lock thingy in the bottom left corner of the window?

Is this really news to anyone?

Re:Why you shoud never use your favorite password on News.YC... by hsiung on Saturday May 31, 2008 @05:44PM (#205445)
There are still ways to add a little extra security for non-ssl logins. One way is by hashing the password via javascript with a random number provided by the server before posting it via HTTP. (see http://pajhome.org.uk/crypt/md5/auth.html)
Re:Why you shoud never use your favorite password on News.YC... by tptacek on Saturday May 31, 2008 @09:18PM (#205551)
That adds no security at all. Security is not an obstacle course.
Re:Why you shoud never use your favorite password on News.YC... by thorax on Sunday June 01, 2008 @10:32AM (#205873)
Security is nothing but an obstacle course. The only time security is not merely an obstacle course is when you completely destroy the thing you're trying to protect.

This is fundamentally something everyone needs to understand about computer security-- it's all about creating bigger and harder obstacles (including literal, physical obstacles). You can never absolutely secure something while it exists.

Re:Why you shoud never use your favorite password on News.YC... by tptacek on Sunday June 01, 2008 @11:55AM (#205932)
That's a fine argument for rejecting all of engineering. An asteroid could always strike the bridge we're building! Why bother making it structurally sound?
Re:Why you shoud never use your favorite password on News.YC... by thorax on Sunday June 01, 2008 @12:36PM (#205967)
I'm not sure why you're treating my comment as an argument to reject security (or to reject anything other than your specific wording choice). I'm just saying that security, fundamentally, is about making obstacles.

There's nothing implied there regarding the importance/unimportance/quality of those obstacles. I don't think understanding its fundamental nature takes anything away from Security.

Re:Why you shoud never use your favorite password on News.YC... by tptacek on Sunday June 01, 2008 @01:29PM (#206002)
That's really not true. I think you're conflating cryptography with security. In crypto, I suppose you could consider algorithms that increase attacker cost as "obstacles", though I think the word loses meaning when the "obstacle" involves summoning more CPU cores than there are atoms in the solar system.

In practical security, closing a buffer overflow, sanitizing inputs, and proving code paths are not "obstacles". There are a finite number of vulnerabilities in any piece of code.

Re:Why you shoud never use your favorite password on News.YC... by DougBTX on Sunday June 01, 2008 @02:12PM (#206039)
In practical security, closing a buffer overflow, sanitizing inputs, and proving code paths are not "obstacles".

I think you're being a bit picky over wording, an "obstacle" is just something which makes it harder for some to break your system, examples of which are closing buffer overflows and sanitizing inputs.

You could, possibly, use it as an argument against engineering, but I think you'd be wrong. The same as someone arguing "we're all going to die anyway so lets get it over with now" is wrong: it means that you have to make the most of what you do have.

Re:Why you shoud never use your favorite password on News.YC... by tptacek on Sunday June 01, 2008 @02:56PM (#206074)
This isn't just pickiness. This is two totally conflicting mindsets about security. I'll be ungenerous and say that mine, which rejects the concept of obstacle courses, is the practitioner's mindset.

We don't let things ship when we know they have exploitable vulnerabilities. We recognize that there are known unknowns and unknown unknowns, and we try to mitigate the former. But the known knowns? Come on. Just turn SSL on. The Javascript rewriting hack is not hard.

Re:Why you shoud never use your favorite password on News.YC... by thorax on Sunday June 01, 2008 @05:55PM (#206208)
I'm not referring to cryptography, I'm referring to security in the general sense. Security is fundamentally about placing obstacles between your assets and those who you don't want to use/alter/control those assets.

When you design software, you have all sorts of assets you'd like to protect, even for the simplest cases. Administrative access, general data, CPU cycles, workflow, network bandwidth, and maybe even passwords, secrets, etc. Your job (with a security design hat on) is to place the firmest obstacles you can between those assets and those you don't want to use them (usually prioritized by a combination of probable risk, severity of loss, and cost to protect).

Thinking in terms of assets you need to protect is a highly recommended way to design securely, regardless of whether you're talking about military, bodyguards, buildings, software, cryptography, or systems. You then proceed to put up your best obstacles and then reshore/rebuild/redesign those obstacles when they are known to be compromised or compromisable. All the while ensuring that the system operates as efficiently as you can reasonably manage.

Fixing "a buffer overflow" is just a method for repairing the software obstacles you already had in place. Sanitizing inputs is, indeed, adding an obstacle for attackers. "Proving code paths" takes into account that your obstacles remain in place to protect your data with certain assumptions about the systems involved.

If you're interested in security engineering in general, I recommend picking up some of the latest (last 5-10 years) literature on Threat Modeling as it really can change one's perspective on what security is all about. A lot of engineers I've worked with think of it in terms of "using the best string library", when it's more about designing systems to protect your assets as best as you can and still get your job done.

There are all sorts of practices, tools, fixes, libraries, etc that help improve existing "bricks" in your obstacles, but they're absolutely no replacement for actually understanding what you're trying to protect and having a strategy for preventing those from being compromised. The best security is designing such that you never put your assets at risk than that you use the right libraries to, for example, manage them during transit.

Re:Why you shoud never use your favorite password on News.YC... by tptacek on Sunday June 01, 2008 @07:31PM (#206271)
Man, this sucks. This is a stupid semantic argument ("obstacle" versus "control" versus "constraint"), but it's also what's wrong with a lot of crappy security out there today.

An obstacle is something you overcome. I don't think you mean it that way, but that's what a lot of people think. So, for instance, a Javascript hashing scheme backed by a Greasemonkey script that tries to verify that passwords actually make it through the hash function. That's good, because it "adds obstacles". The security of the system is the sum of the value of all the obstacles.

No. The security of the system is inevitably the value of the 1-2 most important controls and constraints. Think of it like the difference between O(log n) and an O(n) algorithms: the constant factors don't mean much. So, you can do all sorts of gymnastics with hashes and nonces and salts (and timestamps and sequence numbers and MACs), but you turn SSL on, and now the only thing that matters is SSL.

The "obstacle" mindset, also known as "defense in depth", is what gets us IPS, web application firewalls, and antivirus. None of these $50,000 products work. But they're defended by managers and purchasers and vendors as "another layer in a defense in depth strategy". What we need is software that works, with defenses that are clear and fundamentally sound. What we get, too often, is band-aids.

Again, I apologize, because I'm turning you into a straw man and I don't mean to. The word "obstacle" sets me off. It shouldn't, because obstacles pay for my consulting team and my development team. I should say, "more obstacles, please!" "Please, build another ActiveX control to implement an AES challenge-response protocol with a compiled-in key!" "Please, build another web filter for which every nonminimal UTF-8 encoding variant is another security advisory for!"

Oh well. I'm old.

By the way, being somewhat close to the drama here, I want to note that the "new Threat Modeling" is a bit controversial, the terms are still up in the air, and if you want to learn more about security, you'd be far better off reading Ferguson's "Practical Cryptography" and McDonald, Dowd, and Schuh's "Art of Software Security Assessment".

Don't build obstacle courses. Design stuff that works.

Re:Why you shoud never use your favorite password on News.YC... by cperciva on Sunday June 01, 2008 @07:41PM (#206278)
So, you can do all sorts of gymnastics with hashes and nonces and salts (and timestamps and sequence numbers and MACs), but you turn SSL on, and now the only thing that matters is SSL.

Just as a side note: SSL libraries are big, ugly, and bug-prone. If you use SSL for user logins, your users' login information will be more secure... but your server will be less secure.

Re:Why you shoud never use your favorite password on News.YC... by tptacek on Sunday June 01, 2008 @08:30PM (#206312)
Wow. I think you should support that claim with evidence.
Re:Why you shoud never use your favorite password on News.YC... by cperciva on Sunday June 01, 2008 @09:08PM (#206332)
You want evidence for the fact that SSL libraries have bugs?

http://security.freebsd.org/advisories/FreeBSD-SA-07:08.open... http://security.freebsd.org/advisories/FreeBSD-SA-06:23.open... http://security.freebsd.org/advisories/FreeBSD-SA-06:19.open... http://security.freebsd.org/advisories/FreeBSD-SA-05:21.open... http://security.freebsd.org/advisories/FreeBSD-SA-04:05.open... http://security.freebsd.org/advisories/FreeBSD-SA-03:18.open... http://security.freebsd.org/advisories/FreeBSD-SA-03:06.open... http://security.freebsd.org/advisories/FreeBSD-SA-03:02.open... http://security.freebsd.org/advisories/FreeBSD-SA-02:33.open... http://security.freebsd.org/advisories/FreeBSD-SA-01:51.open...

Is that enough?

OpenSSL and OpenSSH are tied, at 10 advisories each, as the pieces of software which have been responsible for the most FreeBSD Security Advisories -- outdoing Sendmail and BIND (7 advisories each), procfs (6 advisories, and removed from the default system configuration due to its poor record), and tcpdump and cvs (5 advisories each).

Re:Why you shoud never use your favorite password on News.YC... by tptacek on Sunday June 01, 2008 @09:23PM (#206343)
Of the 12 postings you provided, 6 have nothing to do with server security, 2 are dupes, and only two of the remainder date to after 2004. Thanks for making me do that research. I guess I deserve it.

The comparison to Sendmail? Pretty laughable. Why don't you work from the real list of Sendmail vulns, not the ones in your personal database?

Now, I'll respond: under what circumstances would you advise a prospective YC app developer to avoid SSL because of the risk of server vulnerabilities?

Re:Why you shoud never use your favorite password on News.YC... by cperciva on Sunday June 01, 2008 @09:42PM (#206353)
Of the 12 postings you provided ... 2 are dupes

I only posted 10 links, which is probably why you think there were 2 duplicates. :-)

The comparison to Sendmail? Pretty laughable. Why don't you work from the real list of Sendmail vulns, not the ones in your personal database?

FreeBSD security advisories were an easily available list of vulnerabilities which were assessed on the same basis. If I were going to "the real list of Sendmail vuln[erabilities]" (whatever you consider that to be) then I'd also have to use a real list of OpenSSL vulnerabilities -- including those which didn't affect FreeBSD because we didn't ship those versions, and the "oops, last months' security patch was broken" vulnerabilities which didn't affect FreeBSD thanks to the fact that the FreeBSD security team proofreads vendor patches.

under what circumstances would you advise a prospective YC app developer to avoid SSL because of the risk of server vulnerabilities?

If they didn't care about the confidentiality or authenticity of data being transmitted, then I would advise them to not use SSL.

More importantly, if they were using SSL, I'd advise them of the increased risk and suggest additional layers of defence -- for instance, terminating HTTPS within a jail at a proxy which forwards requests in plaintext over a localhost connection.

Of course, individual circumstances always vary, so it's hard to give any sort of blanket advice.

Re:Why you shoud never use your favorite password on News.YC... by tptacek on Sunday June 01, 2008 @09:47PM (#206357)
You have two advisories for the same 0.9.7l get-ciphers vulnerability. I have, as you've noticed, lost the ability to count. Yes, less than 40% of the evidence you provided survives a minute's scrunity.

If you really think OpenSSL has a worse track record than Sendmail, assert it directly. I don't think you will.

I think you've just provided some spectacularly bad advice to web devs here, Colin.

Re:Why you shoud never use your favorite password on News.YC... by cperciva on Sunday June 01, 2008 @10:00PM (#206363)
You have two advisories for the same 0.9.7l get-ciphers vulnerability.

No, there's one advisory for the original vulnerability, and a second advisory for a new vulnerability which was added when OpenSSL shipped a broken patch (this one we didn't notice in time -- mea culpa).

If you really think OpenSSL has a worse track record than Sendmail, assert it directly. I don't think you will.

Overall? No -- Sendmail had a horrible track record in the past. Recently? Yes, I would say that OpenSSL has a worse track record than Sendmail over the past 4 years.

I think you've just provided some spectacularly bad advice to web devs here, Colin.

You're entitled to your opinion, of course, but I'd like to hear more details -- which bit in specific do you consider was bad advice?

Re:Why you shoud never use your favorite password on News.YC... by gojomo on Saturday May 31, 2008 @09:37PM (#205564)
It adds a little. It means that a passive eavesdropper has to mount a offline dictionary attack before knowing the plaintext password. That's better than nothing.
Re:Why you shoud never use your favorite password on News.YC... by tptacek on Saturday May 31, 2008 @10:18PM (#205582)
No. Respectfully, you too have failed to think this through. Attackers with access to raw traffic can (and routinely do) change the traffic. Attackers will simply rewrite your hashing Javascript in transit.
Re:Why you shoud never use your favorite password on News.YC... by gojomo on Saturday May 31, 2008 @11:08PM (#205603)
That's an active attack. My statement was clear and correct. The number of people who can passively eavesdrop on traffic (eg, on open wifi) is much larger than those who can dynamically change traffic in transit.
Re:Why you shoud never use your favorite password on News.YC... by tptacek on Saturday May 31, 2008 @11:42PM (#205621)
There are no passive-only attackers. Attackers who can observe raw traffic can hijack it (if it's the '90s) or redirect it (if it's 5 years ago, and in Brazil, and money is involved --- just to make it specific).

Look, we're locked in an Internet message board death struggle and neither of us are going to concede anything, so let me just finish with this tangent:

If you tried to sell an app to a Fortune 1000 company that defended against passive-only attackers but left logins open to active attackers, and they contracted out a 1 week 1 person web pen test to make sure your app was safe for peripheral customer data to go inside, you'd get dinged for this and you'd cut a dot release.

If, instead of cutting a dot release you explained why it was worth them moving ahead with a pilot that defended against passive attackers, you would Lose The Sale. Seen it happen.

I don't much care about your Hacker News password, but lots of you write applications, and I've seen some of the most unlikely (message boards, bug trackers, blogs---err, content managers) wind up in security audit hell. My advice, take it or leave it: don't bother with these Javascript hash schemes.

Re:Why you shoud never use your favorite password on News.YC... by gojomo on Sunday June 01, 2008 @01:28AM (#205677)
As should have been clear, I wasn't talking about apps with Fortune 1000 company customer data. I certainly did not suggest the mild javascript-hashing technique would be appropriate for such situations. (So, your 90+ word tangent hypothesizing that I might try to sell such a thing is... obdurate? A strawman? Unfair?)

And, you seriously think there are "no" passive-only attackers? No people happy to merely scan or log traffic, not actively hijacking TCP sessions, but looking for info to exploit later? I suggest both the guy in the wifi cafe running a sniffer, and the NSA hardware in AT&T's room 641A, count as "passive-only attackers". Of course the javascript-hashing technique is only helpful against the former.

Re:Why you shoud never use your favorite password on News.YC... by tptacek on Sunday June 01, 2008 @02:53PM (#206072)
It's not 1997 anymore. People don't hijack TCP sessions. Have you ever done that before? It's incredibly noisy.

If you can observe insecure traffic, you can redirect it. The victim's traffic is never going to hit ycombinator.com.

Re:Why you shoud never use your favorite password on News.YC... by volida on Sunday June 01, 2008 @12:35AM (#205650)
you are saying that if someone is encrypting the password using RSA in javascript and then using the hash to exchange the password between server/client, is volnerable because someone can interfere in the traffic and change the javascript served to the user, so that the password is sent in plaintext and therefore steal the password?

then why meebo and other sites practise this method without security problems?

Re:Why you shoud never use your favorite password on News.YC... by eru on Sunday June 01, 2008 @04:13AM (#205747)
The canned argument is: No known security problem does not mean no security problem.
Re:Why you shoud never use your favorite password on News.YC... by tptacek on Sunday June 01, 2008 @11:52AM (#205930)
That's not the argument here, though. The proposed solution --- and the one that Meebo uses, when you don't use their SSL login --- has a glaring security problem.
Re:Why you shoud never use your favorite password on News.YC... by volida on Sunday June 01, 2008 @05:35PM (#206197)
i wasn't proposing it, i asked if thats what you meant
Re:Why you shoud never use your favorite password on News.YC... by volida on Sunday June 01, 2008 @05:38PM (#206200)
i was implying, how come they didn't run into security problem when they are practising a non-safe method? why do they expose so many users to such danger without their knowledge?
Re:Why you shoud never use your favorite password on News.YC... by simonw on Saturday May 31, 2008 @09:27PM (#205558)
Why doesn't it add security? It means the password isn't being transmitted in cleartext (it's using an irreversible hash). For the record, Yahoo! use that exact technique on their login page (though I'm not sure why as it's served over https).

UPDATE: I see from a post further down that you're talking about re-writing the JavaScript in transit. Fair point.

Re:Why you shoud never use your favorite password on News.YC... by mfenniak on Sunday June 01, 2008 @11:23AM (#205905)
The downside to this is that it requires the server to store the password unencrypted and unhashed. The server must have access to the original password to hash with the random number for comparison. In my opinion, this wouldn't be an improvement in the overall security of the system.

Avoid sending a plaintext password by using HTTPS. It's the easiest way.

Re:Why you shoud never use your favorite password on News.YC... by hsiung on Sunday June 01, 2008 @12:34PM (#205963)
You store the password hashed with a salt in the database (just keep track of the salt you used). The server can send the salt to the client, in addition to the random number. So the client is performing two hashes: md5(md5(password+salt)+random_token).
Re:Why you shoud never use your favorite password on News.YC... by breck on Saturday May 31, 2008 @05:57PM (#205451)
Agreed--not news.

However, this is a common security problem that doesn't get enough attention. I would guess the easiest way to crack anyone's bank account is to create some flimsy website that requires users to register. Chances are good they will use the same user/password combo that they would use for their bank. Or you could crack one of the thousands of existing login websites to get passwords, which would be a lot easier than hacking a bank's database.

If I'm writing a minor login website, I'll assign a random password to users. I don't want to be liable if one of my servers is hacked and someone's bank account gets accessed because of it.

What do people out there generally do about this problem? Do you take a similar approach or make additional efforts to secure your servers?

Re:Why you shoud never use your favorite password on News.YC... by cperciva on Saturday May 31, 2008 @06:02PM (#205454)
I don't want to be liable if one of my servers is hacked and someone's bank account gets accessed because of it.

Don't store user passwords in plaintext.

Re:Why you shoud never use your favorite password on News.YC... by breck on Saturday May 31, 2008 @09:06PM (#205543)
I use a hash. I don't quite know how secure that alone is though. My thoughts are if my server is compromised(and an endless stream of attempts lead me to believe it's not extremely unlikely) having both the scripts with the database could deduce the passwords. Am I wrong?
Re:Why you shoud never use your favorite password on News.YC... by orib on Saturday May 31, 2008 @09:15PM (#205548)
You are. One of the defining properties of a cryptographic hash is that you cannot easily deduce the input given the output, nor can you easily construct an input to produce a given output. (see the overview at http://en.wikipedia.org/wiki/Cryptographic_hash)

However, it's still possible to do a dictionary attack on the database of hashes ("is the hash of "password" the same as the user's password hash? yes? Bingo!")

Re:Why you shoud never use your favorite password on News.YC... by eru on Sunday June 01, 2008 @04:20AM (#205753)
You should use individual salting for each password to make this at least a bit more difficult.
Re:Why you shoud never use your favorite password on News.YC... by rw on Saturday May 31, 2008 @09:51PM (#205573)
Provided, of course, that P != NP.
Re:Why you shoud never use your favorite password on News.YC... by tptacek on Saturday May 31, 2008 @10:19PM (#205583)
Message digest functions are not, generally, number-theoretic.
Re:Why you shoud never use your favorite password on News.YC... by cperciva on Saturday May 31, 2008 @11:41PM (#205620)
How is this relevant? The question of P ?= NP isn't limited to number-theoretic functions -- if P = NP then it is possible to find a preimage to any (polynomial time) hash function in polynomial time.
Re:Why you shoud never use your favorite password on News.YC... by tptacek on Saturday May 31, 2008 @11:44PM (#205623)
You're right.
Re:Why you shoud never use your favorite password on News.YC... by jward on Sunday June 01, 2008 @04:04AM (#205745)
A hash is a one way thing so you can't reverse it. However, if they have that much access it'd be trivial to just change your script to dump the username/password combo into a plain text file whenever the login succeeds.
Re:Why you shoud never use your favorite password on News.YC... by adamsmith on Saturday May 31, 2008 @06:45PM (#205478)
and hash the passwords on the browser.
Re:Why you shoud never use your favorite password on News.YC... by anewaccountname on Saturday May 31, 2008 @08:21PM (#205521)
I agree that that will be safe, provided you use the same browser-side hash function that the bank uses
Re:Why you shoud never use your favorite password on News.YC... by theg on Sunday June 01, 2008 @11:05AM (#205890)
You can't have it both ways. If you are hashing the password before it is sent from the client to the server, you need the raw password on the server side.

(Assuming you are concatenating it with a server-provided random value before the hashing.)

Re:Why you shoud never use your favorite password on News.YC... by tptacek on Sunday June 01, 2008 @11:56AM (#205933)
You're assuming they're using a secure challenge response protocol. They're not. They're sending password-equivalent hashes over the wire, so they can say they're not sending passwords.

You'd be right to point out that this is a lot of silly acrobatics to go through to avoid a single SSL login page.

Re:Why you shoud never use your favorite password on News.YC... by kwdowicz on Saturday May 31, 2008 @06:07PM (#205460)
users have million sites where they have logins and passwords - they can't have million password - even pattern can be guessed. If the risk is to low it's ok to not use HTTPS. But some blurring would give positive results - as like some hackers commented already.
Re:Why you shoud never use your favorite password on News.YC... by rplevy on Sunday June 01, 2008 @12:38AM (#205652)
One approach is to invent a mnemonic system for constructing secure passwords. The passwords should be systematically related to the specific site (including variables that are only known or relevant to you), but the patten should not be obvious to anyone but yourself (and memorable enough that the passwords & method of constructing do not need to be explicitly recorded). This makes it possible to have a unique password for every site. As a further foil to anyone who might somehow crack the pattern, use different mental password construction algorithms for sites with different levels of perceived security importance (although then it is easier to get confused).
Re:Why you shoud never use your favorite password on News.YC... by jsteele on Saturday May 31, 2008 @06:23PM (#205471)
A million's a big number. As a User, I'd have to say that a hundred or so passwords sounds about right - and I live online 24/7. For most users - a dozen, tops.
Re:Why you shoud never use your favorite password on News.YC... by thaumaturgy on Sunday June 01, 2008 @06:09AM (#205788)
| For most users - a dozen, tops.

"Most" users have trouble remembering even one password. Rightly or wrongly, it's hard to get the average computer user interested in security.

Re:Why you shoud never use your favorite password on News.YC... by irrelative on Saturday May 31, 2008 @06:05PM (#205457)
Seriously, this isn't your bank account... what if someone breaks in and steals all your karma!

I'm surprised that the crowd here would even blink when hearing this. cperciva is right with his rhetorical question: this shouldn't be news to anyone, especially hackers.

Re:Why you shoud never use your favorite password on News.YC... by jacobbijani on Saturday May 31, 2008 @06:12PM (#205463)
Looks like the point of the post was more to not use the same password you use here as on other sites, and less to worry about your HN account getting hacked.