2026-05-12 21:27CVE-2026-44304GitHub_M
PUBLISHED5.2CWE-90

Lemur: LDAP Filter Injection enables post-authentication privilege escalation

Lemur manages TLS certificate creation. Prior to 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. This vulnerability is fixed in 1.9.0.

Problem type

Affected products

Netflix

lemur

< 1.9.0 - AFFECTED

References

GitHub Security Advisories

GHSA-3r34-vq8m-39gh

Lemur: LDAP Filter Injection enables post-authentication privilege escalation

https://github.com/advisories/GHSA-3r34-vq8m-39gh

Description

Overview

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.

Vulnerable Code

Location: lemur/auth/ldap.py, _bind() method

Filter 1 — User lookup (line ~161):

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):

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.

Impact

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

Exploitation Constraint

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.

Steps to Reproduce

  1. 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"
    
  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,DC=com@corp.example.com
    
  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

Remediation

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)
)

Resources

JSON source

https://cveawg.mitre.org/api/cve/CVE-2026-44304
Click to expand
{
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2",
  "cveMetadata": {
    "cveId": "CVE-2026-44304",
    "assignerOrgId": "a0819718-46f1-4df5-94e2-005712e83aaa",
    "assignerShortName": "GitHub_M",
    "dateUpdated": "2026-05-12T21:27:28.118Z",
    "dateReserved": "2026-05-05T17:39:31.113Z",
    "datePublished": "2026-05-12T21:27:28.118Z",
    "state": "PUBLISHED"
  },
  "containers": {
    "cna": {
      "providerMetadata": {
        "orgId": "a0819718-46f1-4df5-94e2-005712e83aaa",
        "shortName": "GitHub_M",
        "dateUpdated": "2026-05-12T21:27:28.118Z"
      },
      "title": "Lemur: LDAP Filter Injection enables post-authentication privilege escalation",
      "descriptions": [
        {
          "lang": "en",
          "value": "Lemur manages TLS certificate creation. Prior to 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. This vulnerability is fixed in 1.9.0."
        }
      ],
      "affected": [
        {
          "vendor": "Netflix",
          "product": "lemur",
          "versions": [
            {
              "version": "< 1.9.0",
              "status": "affected"
            }
          ]
        }
      ],
      "problemTypes": [
        {
          "descriptions": [
            {
              "lang": "en",
              "description": "CWE-90: Improper Neutralization of Special Elements used in an LDAP Query ('LDAP Injection')",
              "cweId": "CWE-90",
              "type": "CWE"
            }
          ]
        }
      ],
      "references": [
        {
          "url": "https://github.com/Netflix/lemur/security/advisories/GHSA-3r34-vq8m-39gh",
          "name": "https://github.com/Netflix/lemur/security/advisories/GHSA-3r34-vq8m-39gh",
          "tags": [
            "x_refsource_CONFIRM"
          ]
        }
      ],
      "metrics": [
        {
          "cvssV3_1": {
            "version": "3.1",
            "vectorString": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N",
            "attackVector": "NETWORK",
            "attackComplexity": "LOW",
            "privilegesRequired": "LOW",
            "userInteraction": "NONE",
            "scope": "UNCHANGED",
            "confidentialityImpact": "HIGH",
            "integrityImpact": "HIGH",
            "availabilityImpact": "NONE",
            "baseScore": 8.1,
            "baseSeverity": "HIGH"
          }
        }
      ]
    }
  }
}