Loading advisory.
Loading advisory.
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.
Published 2026-05-06 19:16 UTC · Modified 2026-07-13 16:42 UTC
Severity and EPSS are shown separately. Helm does not combine them into one score.
| 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' |
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):
ldap_filter = "userPrincipalName=%s" % self.ldap_principalself.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):
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:
Inject LDAP filter syntax into the username field during login
Manipulate the group membership query to return arbitrary groups
Be assigned the admin role or any other privileged role in Lemur
Gain unauthorized access to all certificates, private keys (via /certificates/<id>/key), and CA configurations
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.
Deploy Lemur with LDAP authentication enabled:
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"Create a valid LDAP user account
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"
}The LDAP filter becomes:
userPrincipalName=validuser)(memberOf=CN=LemurAdmins,DC=corp,DC=example,DC=com@corp.example.comDepending on the LDAP server's parsing, this can alter query semantics
The user is assigned roles they should not have access to
Apply ldap.filter.escape_filter_chars() to all user-controlled values before interpolation:
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)
)CWE-90: https://cwe.mitre.org/data/definitions/90.html
OWASP LDAP Injection: https://owasp.org/www-community/attacks/LDAP_Injection
Python ldap.filter.escape_filter_chars: https://www.python-ldap.org/en/python-ldap-3.4.0/reference/ldap-filter.html
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.002 on 2026-11-24 to 0.003 on 2026-11-26, over 2 recorded scores.
| Date | Score | Previous | Model |
|---|---|---|---|
| 2026-11-24 | 0.002 | first score | v2026.06.15 |
| 2026-11-26 | 0.003 | 0.002 | v2026.06.15 |