News for hackers. Stuff that matters.
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.