Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LDAP Server certificate not validated #58

Open
hstock opened this issue Jul 30, 2015 · 0 comments
Open

LDAP Server certificate not validated #58

hstock opened this issue Jul 30, 2015 · 0 comments

Comments

@hstock
Copy link

hstock commented Jul 30, 2015

I just stumbled on this when setting up a TLS secured LDAP connection in GitLab.

The LDAP connection does work without ever installing our self-signed CA on the GitLab server.

I think this is a big security issue, since centrally managed credentials are a potential target for MITM attacks.

The problem is Net::LDAP which does not activate certificate validation by default:

It's intended for cases where you have an implicit level of trust in the authenticity of the LDAP server. No validation of the LDAP server's SSL certificate is performed. This means that :simple_tls will not produce errors if the LDAP server's encryption certificate is not signed by a well-known Certification Authority. [...] In order to verify certificates and enable other TLS options, the :tls_options hash can be passed alongside :simple_tls or :start_tls.

(See http://www.rubydoc.info/github/ruby-ldap/ruby-net-ldap/Net/LDAP#encryption-instance_method)

The problem with omniauth-ldap is that ensure_method (adaptor.rb line 90) does not allow to pass the :tls_options hash.

Also I think it would be much safer to validate by default and allow an extra parameter for ignoring validation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant