Project

General

Profile

Bug #2909

auth.backend.ldap.starttls encrypts authenticating user password, but not auth.backend.ldap.bind-pw

Added by akschu1 9 days ago. Updated 5 days ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
mod_auth
Target version:
Start date:
2018-09-14
Due date:
% Done:

0%

Estimated time:
Missing in 1.5.x:

Description

Just setup lighttpd with the following:

auth.backend = "ldap"
auth.backend.ldap.hostname = "junewts.domain.net"
auth.backend.ldap.base-dn = "dc=domain,dc=net"
auth.backend.ldap.filter = "(&(objectClass=user)(sAMAccountName=$)(memberOf=CN=Allowed,CN=Users,DC=domain,DC=net))"
auth.backend.ldap.starttls = "enable"
auth.backend.ldap.bind-dn = "CN=lookupuser,CN=Users,DC=domain,DC=net"
auth.backend.ldap.bind-pw = "password"
auth.backend.ldap.allow-empty-pw = "disable"

When sniffing the packets with tcpdump, I see it bind as lookupuser without starting tls, then it starts TLS and tries to bind as the user it found in the filter.

When selecting starttls ligttpd should encrypt both the bind to lookup the user, as well as the bind as the user.

History

#1

Updated by gstrauss 7 days ago

What version of lighttpd are you using? Which package and what version of LDAP libraries?

When configured with auth.backend.ldap.starttls = "enable", lighttpd calls ldap_start_tls_s() prior to ldap_sasl_bind_s().

#2

Updated by akschu1 6 days ago

Hello,

I can't confirm this. According to my packet capture I get this:

LDAPMessage bindRequest(16) "CN=lookupusr,CN=Users,DC=domain,DC=net" simple
messageID: 16
protocolOp: bindRequest (0)
bindRequest
version: 3
name: CN=lookupuser,CN=Users,DC=domain,DC=net
authentication: simple (0)
simple: THEACTUALPASSWORD

then a few searches, then unbindRequest then....

72 0.017358 172.24.0.211 172.24.0.237 TLSv1 371 Client Hello
76 0.023452 172.24.0.237 172.24.0.211 TLSv1 4664 Server Hello, Certificate, Server Key Exchange, Certificate Request, Server Hello Done

So it's pretty clearly only doing TLS for the user part, not the bind-dn part.

I'm using lighttpd-1.4.50.tar.xz compiled like this on slackware:

./configure \
--prefix=/usr \
--libdir=/usr/lib64/lighttpd \
--sysconfdir=/etc \
--localstatedir=/var \
--mandir=/usr/man \
--with-pcre \
--with-attr \
--with-openssl \
--with-ldap \
--build=$ARCH-slackware-linux

openldap is openldap-client-2.4.42-x86_64-1 from slackware.

If you want I can send you the packet capture, but don't want to post it here, as it's has private information.

#3

Updated by gstrauss 5 days ago

Thanks for the update. I'll have to set up a test environment to reproduce this, which may take me some time with $dayjob demands.

#4

Updated by akschu1 5 days ago

Yea, my C is terrible, but I might be able to figure it out and supply a patch... depends on my workload too.

Oh, and thanks for working on lighttpd, I needed something small for an embedded project, but I really like what I see, and I'm not impressed easily.

Also available in: Atom