Loading advisory.
Loading advisory.
Lemur: LDAP Authentication Globally Disables TLS Certificate Verification When LDAP_USE_TLS Is Enabled
When LDAP TLS is enabled (LDAP_USE_TLS = True), Lemur's LDAP authentication module unconditionally disables TLS certificate verification at the global ldap module level. This allows a man-in-the-middle attacker positioned between Lemur and the LDAP server to intercept all authentication credentials.
Published 2026-05-06 18:48 UTC · Modified 2026-07-13 16:42 UTC
Severity and EPSS are shown separately. Helm does not combine them into one score. How tiers work
| Package | Ecosystem | Affected | Fixed in | Upgrade command |
|---|---|---|---|---|
| lemur | PyPI | < 1.9.0 versions 0.11.0, 0.2.1, 0.8.0, 0.8.1, 0.9.0, 1.0.0, 1.1.0, 1.2.0, 1.3.1, 1.3.2, 1.4.0, 1.5.0, 1.6.0, 1.7.0, 1.8.0, 1.8.1, 1.8.2 | 1.9.0 | pip install --upgrade 'lemur>=1.9.0' |
When LDAP TLS is enabled (LDAP_USE_TLS = True), Lemur's LDAP authentication module unconditionally disables TLS certificate verification at the global ldap module level. This allows a man-in-the-middle attacker positioned between Lemur and the LDAP server to intercept all authentication credentials.
Location: lemur/auth/ldap.py, _bind() method, line ~172
if self.ldap_use_tls:
ldap.set_option(ldap.OPT_X_TLS_REQUIRE_CERT, ldap.OPT_X_TLS_NEVER)Key issues:
ldap.set_option() is a global call (as opposed to self.ldap_client.set_option()), meaning it disables TLS verification for the entire Python process, not just this connection
OPT_X_TLS_NEVER means no certificate validation is performed whatsoever — self-signed, expired, wrong hostname, and revoked certificates are all silently accepted
There is no configuration option to override this behavior — TLS verification is always disabled when TLS is enabled
A network-positioned attacker (man-in-the-middle) between Lemur and the LDAP server can:
Intercept all LDAP credentials (usernames and plaintext passwords) for every user who authenticates
Modify LDAP responses to inject arbitrary group memberships, granting admin access
Compromise the entire PKI infrastructure managed by Lemur, since authentication controls access to certificates and private keys
This is particularly severe because Lemur is a certificate management system — the tool designed to manage TLS security is itself vulnerable to a TLS attack.
Deploy Lemur with LDAP TLS enabled:
LDAP_AUTH = True
LDAP_USE_TLS = True
LDAP_BIND_URI = "ldaps://dc.corp.example.com"Intercept the LDAP connection using a TLS proxy (e.g., mitmproxy or stunnel):
# Generate a self-signed certificate
openssl req -x509 -newkey rsa:2048 -keyout mitm.key -out mitm.crt -days 1 -nodes -subj "/CN=mitm"
# Proxy LDAP traffic
stunnel -d 0.0.0.0:636 -r real-ldap-server:636 -p mitm.pemPoint Lemur's LDAP_BIND_URI at the proxy (or perform ARP spoofing/DNS hijacking)
Observe that Lemur connects without any certificate verification error
All credentials are visible in the proxy's TLS session
Remove the global TLS verification bypass and default to strict verification:
if self.ldap_use_tls:
# Use instance-level option, not global
self.ldap_client.set_option(ldap.OPT_X_TLS_REQUIRE_CERT, ldap.OPT_X_TLS_DEMAND)
self.ldap_client.set_option(ldap.OPT_PROTOCOL_VERSION, 3)
if self.ldap_cacert_file:
self.ldap_client.set_option(ldap.OPT_X_TLS_CACERTFILE, self.ldap_cacert_file)If backward compatibility is needed, make it configurable with a secure default:
tls_require_cert = current_app.config.get("LDAP_TLS_REQUIRE_CERT", ldap.OPT_X_TLS_DEMAND)
self.ldap_client.set_option(ldap.OPT_X_TLS_REQUIRE_CERT, tls_require_cert)CWE-295: https://cwe.mitre.org/data/definitions/295.html
python-ldap TLS documentation: https://www.python-ldap.org/en/python-ldap-3.4.0/reference/ldap.html#tls-options
No public exploit code known to Helm's sources (Nuclei templates, Metasploit, Exploit-DB and PoC-in-GitHub). That does not mean none exists.
EPSS went from 0.001 on 2026-11-24 to 0.001 on 2026-11-26, over 2 recorded scores.
| Date | Score | Previous | Model |
|---|---|---|---|
| 2026-11-24 | 0.001 | first score | v2026.06.15 |
| 2026-11-26 | 0.001 | 0.001 | v2026.06.15 |