Lemur: LDAP Authentication Globally Disables TLS Certificate Verification When LDAP_USE_TLS Is Enabled
Date: 2026-05
Affected: pip/lemur
Attack vector: other
Category: vulnerability-disclosure
Severity: Medium
CVE: CVE-2026-44305
CWE: CWE-295
CVSS: 6.8 (CVSS:3.1/AV:A/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N)

## Description ### Overview 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. ### Vulnerable Code **Location:** `lemur/auth/ldap.py`, `_bind()` method, line ~172 ```python if self.ldap_use_tls: ldap.set_option(ldap.OPT_X_TLS_REQUIRE_CERT, ldap.OPT_X_TLS_NEVER) ``` Key issues: 1. `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 2. `OPT_X_TLS_NEVER` means no certificate validation is performed whatsoever — self-signed, expired, wrong hostname, and revoked certificates are all silently accepted 3. There is no configuration option to override this behavior — TLS verification is always disabled when TLS is enabled ### Impact 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


Mitigations:

Architectural layers (MAESTRO):