News for hackers. Stuff that matters.
Re:Facebook Stored Hundreds of Millions of User Passwords in... by kitsune_ on Thursday March 21, 2019 @11:51AM (#19453783)
Data anonymization and de-identification is nothing new. Especially when it comes to logging. I don't get why a lot of you are downplaying it in this thread. This is just as bad as plain text passwords.
Re:Facebook Stored Hundreds of Millions of User Passwords in... by hak8or on Thursday March 21, 2019 @12:02PM (#19453896)
The diffirence is intent and/or gross negligence. Storing passwords in plain text in a database requires a gross lack of security mentality in both design stages and implementation changes. It is also drilled into people's brains constantly about how bad of an idea it is. To put it simply, it cannot happen accidentally.

Logging like this can easily be attributed to an accident. The person who implemented this logging should get hit with some repercussions because he surely tested the logging and must have seen the passwords when glancing by eye. But other than that, this was clearly a minor oversight.

Re:Facebook Stored Hundreds of Millions of User Passwords in... by wrs on Thursday March 21, 2019 @12:22PM (#19454118)
Yes. Consider this not-unlikely scenario: The people who implemented the logging did it as a feature of a generic API proxy (there’s no way Facebook implements logging separately for each of their bazillion services!), and no doubt put in a provison for masking sensitive data. They tested it and it worked fine.

Then some devs miles and years away didn’t use that feature properly and accidentally failed to not log passwords in an incoming request. They may not even have been looking at those request logs because that’s not the request they were testing.

Then that feature went into production and this oversight was magnified millions of times.

At large scale you don’t just tail the production log firehose and look for stuff. You have to search for specifics to find anything st all. So if nobody was debugging this thing in production it’s quite plausible nobody saw the passwords in the log.

One way to catch this sort of thing is sentinel data — in this case, have a unique value for a test account’s password and test every service with it, then search everywhere you can think of for that value.

Re:Facebook Stored Hundreds of Millions of User Passwords in... by grahn on Thursday March 21, 2019 @12:44PM (#19454390)
So here is the thing: It was presumably relatively easy for you to come up with that scenario, which you called "not-unlikely". Then what you do is you put that scenario into your risk analysis when you're designing the authentication architecture, and figure out mitigations to make sure that particular mistake becomes (very) unlikely.

The notion that "it could easily happen" that is being brought up throughout this thread should really only suggests that people aren't doing even rudimentary security assessments (or, hopefully, they're not working with security sensitive software).

If you can't solve it technically, you solve it through processes and training. Same goes for any other industry -- if a construction worker said that it's just one bad morning away from dropping a two tonne girder on a playground, we would never accept that. Or a pilot crashing an airliner into the waiting hall when they're supposed to land. Somehow it seems that large parts of the software industry simply hasn't reached the level of maturity we expect from pretty much all other industries.

Facebook is an enormous company. They should be able to have entire departments working on these topics. It's not a one-person hobby project we're talking about.

Re:Facebook Stored Hundreds of Millions of User Passwords in... by wrs on Thursday March 21, 2019 @03:03PM (#19456109)
I'm sure they did figure out mitigations. They failed. Things fail. Two airliners just failed rather spectacularly, and that's the very industry you're benchmarking against.

>Somehow it seems that large parts of the software industry simply hasn't reached the level of maturity we expect from pretty much all other industries.

True, but that's a rather broad brush — in terms of actual risk of damages there is nowhere near an equivalence between "airliner crashing into waiting hall" and "logging some plaintext passwords".

Of course the culture, priorities, and domain are also very different between social network engineering and airliner engineering, which is by the way one reason Facebook could grow from nothing to mind-bogglingly gigantic in a decade, while it takes a decade to get just one new airliner into production.

Re:Facebook Stored Hundreds of Millions of User Passwords in... by grahn on Thursday March 21, 2019 @03:38PM (#19456410)
The point I was making by comparing to a pilot, which I realise I could have expressed a lot more clearly, is that it is perfectly possible to mitigate risks through proper training and procedures even if it's not possible technically. (I.e. all it takes for a plane to crash is to turn the flight controls a few centimetres in the wrong way at the wrong time, yet it almost never happens.)

Of course things fail and people screw up. What I don't agree with are arguments along the lines of this just being a slight oversight, and that those can easily happen. It should require serious failure on multiple levels for anything like this to happen at that scale, if they are implementing things properly, not minor oversight.

Re:Facebook Stored Hundreds of Millions of User Passwords in... by wrs on Thursday March 21, 2019 @06:16PM (#19457901)
Exactly — my scenario was an example of how failures at multiple levels could have caused this to happen. My "not-unlikely" is meant retroactively — now that it's happened, what's a not-unlikely explanation for how it was allowed to happen in a company the size of Facebook?

I didn't intend to imply it was a "slight oversight" — it's clearly a significant oversight — but there are people saying it's obviously gross negligence because how could this ever happen in a company that wasn't completely incompetent, etc. No, terrible accidents can and do happen even in companies that are trying hard to do a good job. Just like when a 737 crashes, you shouldn't assume Boeing is totally incompetent, but rather that several things must have gone wrong at once.

Re:Facebook Stored Hundreds of Millions of User Passwords in... by lacey on Thursday March 21, 2019 @02:31PM (#19455743)
> The notion that "it could easily happen" that is being brought up throughout this thread should really only suggests that people aren't doing even rudimentary security assessments

Precisely.

Re:Facebook Stored Hundreds of Millions of User Passwords in... by zrobotics on Thursday March 21, 2019 @12:14PM (#19454026)
How is this in any way better or more excusable? Calling it a 'minor oversight' could also apply to the DB being in plaintext.

Storing passwords in a plaintext DB heppes in the same manner-a dev is lazy or ignorant of the security reprocussions. Which is what happened here; barring evidence this was done maliciously we can assume that this was accidental. But that doesn't make it any more excusable, since it should be clear that logs can also contain sensitive data that needs to be protected/anonymized.

Considering how selective FB is for hiring, I would hope we could expect a higher standard.

Re:Facebook Stored Hundreds of Millions of User Passwords in... by glenneroo on Thursday March 21, 2019 @12:35PM (#19454285)
Not to mention 200-600 million users had their passwords exposed for many years. That must be a massive trove of log files.
Re:Facebook Stored Hundreds of Millions of User Passwords in... by Aeolun on Thursday March 21, 2019 @12:19PM (#19454085)
I see this differently. If someone stores passwords in plaintext in the database, they’re idiots that don’t know any better.

If someone logs your password in plaintext but has it encrypted in the database that’s grossly negligent.

Re:Facebook Stored Hundreds of Millions of User Passwords in... by lacey on Thursday March 21, 2019 @12:16PM (#19454052)
You assume that storing passwords in plaintext is intent as opposed to gross negligence. In many past instances it’s been intentional and gross negligence because the people making all the design and implementation choices were not knowledgeable about best practices.
Re:Facebook Stored Hundreds of Millions of User Passwords in... by cflewis on Thursday March 21, 2019 @11:59AM (#19453865)
Because we all know we are one bad morning away from doing it ourselves. People are distinguishing between extreme incompetence (storing plaintext passwords in databases) vs people trying to do their jobs.

It's the same reason when there are large outages, where the comments are split between the enraged customers, and then the ones that are "Man, sucks to be them" as know they could easily have been the one that got the config push wrong.

Re:Facebook Stored Hundreds of Millions of User Passwords in... by kitsune_ on Thursday March 21, 2019 @12:08PM (#19453958)
The fact that sensitive data like this is just one config push away from being exposed means it's a brittle design (not just the code, but the entire design /review / deployment process - this is a platform with 1 billion users, not your 1-dev WordPress webpage). That said, this is further aggravated by the simple fact that for whatever reason, 20k of their employees had access to these logs.

All in all it just paints a picture of an irresponsible company where their house is not in order.

Re:Facebook Stored Hundreds of Millions of User Passwords in... by lostapathy on Thursday March 21, 2019 @01:00PM (#19454595)
Exactly. It's one thing not to have enough controls in place to catch something like this on the forum for your warcraft guild. It's another thing entirely when you operate at the scale of Facebook.
Re:Facebook Stored Hundreds of Millions of User Passwords in... by untog on Thursday March 21, 2019 @12:11PM (#19453993)
"people are distinguishing between extreme vs people trying to do their jobs"

Those things are in no way exclusive. Storing passwords in plaintext is awful practise. Including the contents of form submissions in logging is a similarly awful practise. I really don't see what the difference is.

Re:Facebook Stored Hundreds of Millions of User Passwords in... by munk-a on Thursday March 21, 2019 @12:19PM (#19454090)
I like logging and at our company we blanket log all GET parameters on every request, similarly I think it's a Good Idea™ to never log POST parameters, but there are some pages where we've started logging some whitelisted ones because they can help diagnose some errors we run across, but, in an environment where all data is coming into the server in JSON blobs attached in request bodies then it can be a bit harder to make any sort of blanket whitelist.
Re:Facebook Stored Hundreds of Millions of User Passwords in... by ApolloFortyNine on Thursday March 21, 2019 @12:30PM (#19454223)
Earlier in the thread:

>Because there's two types of storing passwords in plain text. There's the "your password is stored in plaintext in the database" way which everyone agrees is 10 different kinds of stupid, and then there's the "we accidentally logged the body of all requests that went through this system, and it turns out login requests came through here" kind.

Basically the conscious decision to store passwords in plain text is worse than unintentionally doing so in logs. One is purposeful, one is not. Yes it's bad, but it's not as bad as if it was done on purpose. And generally, this how most laws are enforced or implemented.

Re:Facebook Stored Hundreds of Millions of User Passwords in... by untog on Thursday March 21, 2019 @12:44PM (#19454392)
Can't both be attributed to ignorance? You could store passwords in plaintext in a database because you didn't know better. You can store plaintext passwords in logs because you don't know better. If I store passwords in plaintext am I being purposeful or am I being ignorant of best practises?

I think people are drawing a distinction where one doesn't really exist.

Re:Facebook Stored Hundreds of Millions of User Passwords in... by ApolloFortyNine on Thursday March 21, 2019 @12:55PM (#19454525)
>You can store plaintext passwords in logs because you don't know better.

This whole conversation is about how it likely was not done on purpose, and that it was the result of logging HTTP requests and responses.

If they wrote logger.info(password), yea I'd say that's as outrageous.

Re:Facebook Stored Hundreds of Millions of User Passwords in... by 908087 on Thursday March 21, 2019 @12:04PM (#19453924)
If a single developer is able to push something like this to production without scrutiny in "one bad morning" on a platform with billions of users, the company itself is the problem.
Re:Facebook Stored Hundreds of Millions of User Passwords in... by pmontra on Thursday March 21, 2019 @12:27PM (#19454190)
I'm working with Rails and Phoenix on two different projects right now and all of them filter out passwords in the log files [1] [2].

I'm also working on a Django project but we're not logging HTTP calls arguments there. I think we could use a filter like [3] but I'd rather have the framework to automatically take care of that.

And if I'd be writing a web app from scratch, no matter if I've been doing web for 25 years, I'm sure I'll do a lot of silly mistakes. That's why I prefer to build on top of frameworks.

[1] https://guides.rubyonrails.org/configuring.html#rails-genera...

[2] https://hexdocs.pm/phoenix/Phoenix.Logger.html

[3] https://djangosnippets.org/snippets/2966/

Re:Facebook Stored Hundreds of Millions of User Passwords in... by EnFinlay on Thursday March 21, 2019 @12:00PM (#19453873)
You're right, the impact is just as bad. I think people in this thread (including myself) are downplaying it because it's a very easy mistake to make, rather than a terrible design decision.
Re:Facebook Stored Hundreds of Millions of User Passwords in... by staticassertion on Thursday March 21, 2019 @12:20PM (#19454099)
The major difference is that we don't have standard patterns for protecting against one attack, vs the other.

With password storage everyone knows the patterns, or we expect them to.

With everything between the request and password storage, we don't.

This type of attack could easily be prevented. When secrets come in, immediately store them (ideally at the web framework level) in a type that overrides print/debug formatting. Then add a "get_raw" to it, and you can now grep for that being used anywhere outside of storage to a DB (and your DB libs should take the Secret type too). Or don't use a `get_raw` and instead use a `hash` method that returns a safely hashed version of it.

Further, your secret type could at the very least add a round of SHA256, maybe even with a pepper?, just to be sure.

This isn't hard, I've done it before. The problem is that it isn't something that people feel embarrassed not to do, vs storing plaintext creds.

Impact is the same - creds are plaintext in a DB. Attackers always expect sensitive data in logs, so it isn't as if you'd get lucky and they'd miss this.

Re:Facebook Stored Hundreds of Millions of User Passwords in... by aeorgnoieang on Thursday March 21, 2019 @02:37PM (#19455818)
> When secrets come in, immediately store them (ideally at the web framework level) ...

But, in practice, a lot of this stuff is being logged by things like proxies that could be several layers in front of the "web framework level".

Re:Facebook Stored Hundreds of Millions of User Passwords in... by staticassertion on Thursday March 21, 2019 @03:14PM (#19456203)
Do proxies usually log POST data? Are these proxies terminating TLS?

Either way, yeah, you're right - it is not a perfect solution. But it means that for any system your engineers build, so long as they build them using your web framework that imposes this password type, you can grep your codebase for bugs.

You could implement client side hashing as a best-effort "in transit" mechanism but that has obvious downsides. Not sure how I'd feel about that approach in practice, but I can't see a big downside.

Re:Facebook Stored Hundreds of Millions of User Passwords in... by newaccoutnas on Thursday March 21, 2019 @12:11PM (#19453991)
A mistake that should have been found very quickly, given the eyes. Not for years without ever apparently being known (I find that hard to believe)
Re:Facebook Stored Hundreds of Millions of User Passwords in... by EpicEng on Thursday March 21, 2019 @01:03PM (#19454637)
When you're FB, Google, ADP, a bank, whatever, you have failed if this sort of thing is "an easy mistake to make." Responsibility should never fall on a single dev or team to begin with. This was going on for _years_.

It's either ametuer hour over there or the organization simply doesn't care enough to invest heavily in the protection of their users.