News for hackers. Stuff that matters.
Re:Millions of accounts compromised because there is no spec... by Spooky23 on Tuesday April 21, 2015 @09:51PM (#9418256)
There is such a beast, it's called LDAP. There are any number of directory and authorization services, and they have probably been around for decades.

There are dozens of directory server options, and probably a few dozen secure authorization solutions, from Kerberos and SAML to proprietary solutions like SiteMinder. Together, these solutions give you EIAM capability that does what you described.

Re:Millions of accounts compromised because there is no spec... by viraptor on Tuesday April 21, 2015 @11:40PM (#9418550)
While technically you're right (as in, LDAP is great for handling many user entries and auth[nz] correctly), in practice it's not going to happen. Nobody knows LDAP (as in, take a random sample of non-corporate developers and most likely none of them will know LDAP). It's a pain to integrate and operate in a small environment. That's why there's a call for a simple solution.

It's why everyone uses JSON and not ASN.1. Why people will save a single number in a file rather than standing up Oracle database. Or why they still use random invented rot-level "encryption" for messages rather than pgp.

LDAP doesn't expose operations like "create new user", "verify password", "deactivate user", "set encryption method to ...". It's a database where you "bind" your user description against your hierarchy of objects/attributes - explain that to a guy who just wants to get his new app idea working ASAP... It's got its own query language too. You can even do LDAP query injections - just like in SQL!

Like you said - LDAP is a beast. It's great and I'd use it as soon as number of users goes over 10k, or employees on different levels over 10. But otherwise, no way. A new component with its own security issues is just not worth it.

Re:Millions of accounts compromised because there is no spec... by voltagex_ on Tuesday April 21, 2015 @11:56PM (#9418596)
(Active Directory trigger warning) Even when the number of users goes over 10k I'm not sure it's worth it. I've lost days chasing down random errors to do with DNS or a misbehaving DC... when the error reference looks like http://www.selfadsi.org/errorcodes.htm (although I wish I'd known about MS's err.exe at the time)

And that's just when you're using the recommended connectors (ODBC/ADO.NET). FSM help you if you're using JDBC and the vendor of the $20k+ product hasn't tested against Server 2012.

I wonder if there's any money in providing an LDAP/AD -> REST server.

http://stackoverflow.com/questions/2453769/active-directory-... might be an idea, too.

Re:Millions of accounts compromised because there is no spec... by hyc_symas on Wednesday April 22, 2015 @12:54PM (#9421747)
Buzz, wrong - no such thing as LDAP injection attacks, sorry.
Re:Millions of accounts compromised because there is no spec... by viraptor on Wednesday April 22, 2015 @06:28PM (#9423990)
Come on, it's just one google search away. https://www.owasp.org/index.php/LDAP_injection (but confirms the "nobody knows LDAP" nicely)

Unless you escape your "(cn=$username)" properly, the users can do a lot of fun things.

Re:Millions of accounts compromised because there is no spec... by hyc_symas on Wednesday April 22, 2015 @06:44PM (#9424058)
Nonsense. That page is utter tripe. The 2nd example " ( cn = jonys ) ( | (password = * ) ) " isn't even a valid filter, and a proper LDAP server will discard it. An OpenLDAP libldap-based app won't even be able to generate the request because the library will reject it.

More importantly, an LDAP search filter only goes with an LDAP search request, which is read-only. You cannot use silly parser games like this to destroy a database, like you can in SQL with Little Bobby Tables. https://xkcd.com/327/

Playing games with LDAP search filters can't return you more information than the app was originally authorized to see. It most often won't even return you more than a single record, since most apps that make LDAP queries and expect only a single entry to be returned won't even look at any subsequent entries if they happen to be in the reply.

Canonical LDAP application code to search for a user record, for authentication/authorization purposes, sets the LDAP search sizelimit to 1. Getting more than 1 matching result is an error.

Re:Millions of accounts compromised because there is no spec... by viraptor on Wednesday April 22, 2015 @07:24PM (#9424206)
Uncommon - yes. Can do less than SQL injections - yes. Read-only - yes.

But it does exist. Saying that LDAP auth[nz] code should set sizelimit to 1 is like saying SQL auth[nz] code should set LIMIT 1. Correct and defensive code does that. But there's still code out there which doesn't and is vulnerable.

Then again, I don't think you understood the second example. It's not for auth, but rather user search - which is the probably the second most common corporate ldap usage.

As for LDAP injection being nonsense, how about searching some CVEs:

- LDAP injection and resulting STORED Cross Site Scripting in Events Planner - SmarterMail 7.x (7.2.3925) - https://www.exploit-db.com/exploits/15189/

- Graylog2 before 0.92 allows remote attackers to bypass LDAP authentication via crafted wildcards. - CVE-2014-9217

- PowerDNS before 2.9.18, when running with an LDAP backend, does not properly escape LDAP queries, which allows remote attackers to cause a denial of service (failure to answer ldap questions) and possibly conduct an LDAP injection attack. - CVE-2005-2301

And many many more...

Re:Millions of accounts compromised because there is no spec... by hyc_symas on Wednesday April 22, 2015 @11:43PM (#9424908)
For user search you still would set a size limit, and a server admin would set a server-side size limit to avoid other resource hogging issues.

I concede the point that there's poorly written code out there that is vulnerable. Still, to lump this into the label of "injection attack" along the lines of SQL injection attacks is grossly misleading. An SQL injection attack can cause destruction of data, invocation of arbitrary commands on the backend, and innumerable kinds of other mischief. A misparsed LDAP filter can do none of these things.

Re:Millions of accounts compromised because there is no spec... by andrewstuart on Tuesday April 21, 2015 @09:59PM (#9418280)
My uninformed perception of OpenLDAP is that it is a large, generalised enterprise class directory service that does alot of stuff. The post suggests a minimal, lightweight user database that does nothing at all else - is that the same thing as OpenLDAP?
Re:Millions of accounts compromised because there is no spec... by Spooky23 on Tuesday April 21, 2015 @10:17PM (#9418342)
Pretty much.

I wouldn't characterize the magical detection of uncommon access patterns as a minimalist feature (it can be done, but not out of the box in a meaningful way), but other than that, all of the stuff you mentioned is there.

Typically, you use LDAP as a directory store, and a dedicated authentication protocol like Kerberos or SAML for authentication. You can also use LDAP for auth if desired.

If you want to go deep on identity management, the NIST documents are pretty much the canonical source of information. http://csrc.nist.gov/projects/iden_ac.html

In any case, don't reinvent the wheel. Just because bozos implement user auth in a MySQL table doesn't mean solutions don't exist. It just means that they are bozos. It's one of the reasons I disapprove use of SaaS apps that don't support federated identity at work.

Re:Millions of accounts compromised because there is no spec... by andrewstuart on Tuesday April 21, 2015 @10:28PM (#9418366)
Does OpenLDAP meet the stated need for a minimal solution that does nothing else apart from the small set of required functions?

I get the impression that OpenLDAP is a big beast that does much, much more.

I'm wanting a fast motorbike and you're pointing at a 16 wheel heavy hauler saying "see, same thing, the hauler has at least two wheels and an engine".

Re:Millions of accounts compromised because there is no spec... by Spooky23 on Tuesday April 21, 2015 @10:38PM (#9418398)
Note I didn't endorse OpenLDAP at all. Not sure if that's the best solution -- I'd probably steer towards 389 server or something similar with Netscape heritage.

You also said:

"Another problem is that developers roll their own user and password management systems and get things like salting and hashing wrong, making the data vulnerable."

You're asking for a distributed, secure system for processing user data and credentials. The most common systems in production globally for doing this (Microsoft Active Directory) are based on technologies developed in the 80's and only being supplanted in recent years. There's a reason for that, and if it were a trivial problem, we wouldn't have pervasive solutions using 1980s RPC in 2015 still running most businesses!

Re:Millions of accounts compromised because there is no spec... by untog on Tuesday April 21, 2015 @10:38PM (#9418400)
There is sometimes a reason for a piece of software being large. Security is one of those reasons.

If you want a secure system you shouldn't be prioritising a "minimal solution". As the previous poster said, don't reinvent the wheel.

Re:Millions of accounts compromised because there is no spec... by ubernostrum on Tuesday April 21, 2015 @11:54PM (#9418594)
I wouldn't characterize the magical detection of uncommon access patterns as a minimalist feature (it can be done, but not out of the box in a meaningful way)

I'm not even sure about a meaningful way. For sake of portability the DB will need to have some way to dump everything. And if a server admin can do that, then someone who can get the same access as a server admin can do it, and we're back to square one.

Re:Millions of accounts compromised because there is no spec... by hyc_symas on Wednesday April 22, 2015 @01:00PM (#9421781)
OpenLDAP comes with a lot of optional modules to implement enterprise directory features. You don't need to use them all. You can build a minimal OpenLDAP system that's dedicated to user authentication that runs in under 4MB of RAM, with full TLS/SASL/GSSAPI security. You can't even do that with SQLite, the SQLite binary alone is 2MB and that doesn't give you any network interface or security features.
Re:Millions of accounts compromised because there is no spec... by SFjulie1 on Tuesday April 21, 2015 @11:43PM (#9418560)
LDAP is a network protocol.

It supports a lot of backends (SQL and NoSQL alike) (openLDAP has nice proxy features)

It also supports role based authentication.

But at the opposite of actual NoSQL data bases, even though it has no structures, it is strongly typed and secure.

You map your NoSQL structures to structured backend through a mapping.

It is awesome but most devs hates it, because they are (at my opinions) ignorants. And developers hates it because they are lazy.

Re:Millions of accounts compromised because there is no spec... by smoyer on Tuesday April 21, 2015 @11:06PM (#9418458)
Try OpenLDAP with Fortress and you get a RESTful interface and ANSI RBAC compliant roles and permissions.
Re:Millions of accounts compromised because there is no spec... by halostatue on Tuesday April 21, 2015 @10:42PM (#9418414)
True, but having been involved in the development of an LDAP client, LDAP is a horribly complex system to implement against (and its built on top of ASN.1, which is possibly worse) and it was slow to get security features (LDAPS, etc.)—and in many cases, no two LDAP servers work quite the same (the most common LDAP server, ActiveDirectory, is the worst for this).

There is a need for something secure by default that is easy to use, easy to set up, easy to deploy, etc. Where this will be difficult is https://xkcd.com/927/.

Re:Millions of accounts compromised because there is no spec... by whoopdedo on Tuesday April 21, 2015 @11:34PM (#9418535)
I've always wondered when I hear someone complain about the complexity, then where did it get the 'L' in its name from?
Re:Millions of accounts compromised because there is no spec... by wmf on Tuesday April 21, 2015 @11:44PM (#9418564)
AFAIK LDAP is a simplified version of X.400, which was part of the truly horrible ISO protocol stack.
Re:Millions of accounts compromised because there is no spec... by gnu8 on Tuesday April 21, 2015 @10:41PM (#9418411)
Thanks for providing the voice of reason in this conversation.
Re:Millions of accounts compromised because there is no spec... by bagels on Tuesday April 21, 2015 @11:45PM (#9418567)
Can existing LDAP implementations scale a single directory to hundreds of millions of users?

I can find no clear answer after a few minutes of searching.

Re:Millions of accounts compromised because there is no spec... by beagle3 on Wednesday April 22, 2015 @06:41AM (#9419485)
You can probably list the organizations (outside of China, perhaps) that have over a hundred million of users in a twitter message - (Facebook;Twitter;Google;Walmart;WhatsApp;Instagram;Hotmail;Snapchat;Yahoo;IRS[0];Blizzard;AOL;AT&T;Verizon) is probably more than 30% of the list already. And AFAIK not a single one of them uses LDAP - but assume one of them does.

So, practically speaking - does it matter?

[0] And equivalent for each country with >70M people

Re:Millions of accounts compromised because there is no spec... by hyc_symas on Wednesday April 22, 2015 @12:53PM (#9421736)
You're quite wrong here. Google, AT&T and Verizon on your list use OpenLDAP. OpenLDAP scales to billions of users in a single instance, and of course it distributes across multiple nodes for even greater scaling as needed. Most of the telcos around the world use it now; it scales far beyond every other data storage technology out there.

http://symas.com/docs/2014-LOADays-jkozyra.pdf

80% of the US population that owns cellphones are OpenLDAP users, whether they realize it or not. 90% of the US population that subscribes to cable TV (Comcast, Time-Warner, etc.) as well. Nothing else actually works for hundreds of millions of users. These companies know, they've tried a lot of "solutions" already.

Re:Millions of accounts compromised because there is no spec... by beagle3 on Wednesday April 22, 2015 @04:38PM (#9423388)
Then I'm glad to stand corrected - I suppose I'm horribly out of date from the days they tried other "solutions". I'm less surprised about AT&T and Verizon, more surprised about Google.

My own personal experience with LDAP in general (and some with OpenLDAP in particular) dates back to 2000 or so -- and at some point I just gave up on the complex and unreliable beast that it was (for whatever reason, BDB would occasionally lock up or get corrupted) - but I know a lot has changed since, LMDB is amazing -- I guess it is time for another look.

Re:Millions of accounts compromised because there is no spec... by hyc_symas on Wednesday April 22, 2015 @07:16PM (#9424181)
OpenLDAP didn't start to become seriously usable until about 2003 (that's when HP dropped SunDS and adopted OpenLDAP for all of their global infrastructure). A lot of work went into it in the 2001-2002 timeframe to get it there. Yeah, a lot has changed, you've missed a couple generations of advancements. BDB's complexity was definitely a pain, but that's all in the past.
Re:Millions of accounts compromised because there is no spec... by Spooky23 on Wednesday April 22, 2015 @10:02AM (#9420447)
I'm pretty sure that with the appropriate infrastructure, The answer is yes. From a scaling limits POV, AD can support billions of objects. Pretty sure the Netscape derivatives (Oracle, the former Sun Directory Server, Red Hat) have implementations that large. I've worked with one with 40M user accounts and we weren't near any scaling limits.
Re:Millions of accounts compromised because there is no spec... by viraptor on Wednesday April 22, 2015 @12:07AM (#9418615)
OpenLDAP is limited by LMDB, which is pretty much limited only by what your filesystem and address space can handle. For scaling out it does support multi-master and slave configurations. So yes, it should.