CVE-2026-44304: Lemur LDAP Filter Injection Enables Post-authentication Vulnerability

HIGH
Advisory Identifier: GHSA-3r34-vq8m-39gh
CVSS 8.1
CWE-90
Published
Advisory Summary

CVE-2026-44304 is a HIGH (CVSS 8.1) ldap filter injection enables post-authentication vulnerability (CWE-90: Improper Neutralization of Special Elements used in an LDAP Query ('LDAP Injection')) affecting Lemur libraries in the PyPI ecosystem. The issue involves ldap filter injection enables post-authentication privilege escalation. Remediation is available by upgrading affected packages to version 1.9.0.

CVE-2026-44304 at a Glance

CVE Identifier CVE-2026-44304
GHSA Identifier GHSA-3r34-vq8m-39gh
Severity HIGH
CVSS v3.1 Base Score 8.1
CWE Classification CWE-90: Improper Neutralization of Special Elements used in an LDAP Query ('LDAP Injection')
Affected Product Lemur
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 8.1

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2026-44304

To remediate this vulnerability, upgrade all affected Lemur dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

lemur fixed: 1.9.0
pip install lemur>=1.9.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show lemur

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2026-44304, inspect your installed packages using pip:

pip show lemur

Analyze the terminal output to locate any version of Lemur in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.9.0), your application is affected.

Note: The pip show lemur command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-90: Improper Neutralization of Special Elements used in an LDAP Query ('LDAP Injection'), where the product constructs all or part of an ldap query using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended ldap query when it is sent to a downstream component. In Lemur, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## 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):** ```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. ### 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: ```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,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: ```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) ) ``` ### Resources - 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

CVE-2026-44304 Affected Lemur Versions

1 component(s)
Fixed Versions:
1.9.0
Product / Package Ecosystem Affected Versions Fixed Version
lemur
PyPI
< 1.9.0
1.9.0

References

Frequently Asked Questions

What is CVE-2026-44304?
CVE-2026-44304 is a security vulnerability in Lemur involving LDAP Filter Injection enables post-authentication privilege escalation under CWE-90: Improper Neutralization of Special Elements used in an LDAP Query ('LDAP Injection').
Which Lemur versions are affected?
Affected versions include releases prior to 1.9.0 across affected packages: lemur.
What version fixes CVE-2026-44304?
Upgrading to 1.9.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is lemur affected?
Yes, lemur is affected in releases prior to 1.9.0. Upgrade your dependency to 1.9.0 or later.
What is the CVSS score of CVE-2026-44304?
CVE-2026-44304 has a CVSS v3.1 base score of 8.1 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N.
What CWE is associated with CVE-2026-44304?
CVE-2026-44304 is classified under CWE-90: Improper Neutralization of Special Elements used in an LDAP Query ('LDAP Injection') (The product constructs all or part of an LDAP query using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended LDAP query when it is sent to a downstream component.).
How can I check PyPI dependencies for CVE-2026-44304?
Run the dependency tree command: 'pip show lemur'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-3r34-vq8m-39gh",
  "modified" : "2026-05-13T16:41:43Z",
  "published" : "2026-05-06T19:16:59Z",
  "aliases" : [ "CVE-2026-44304" ],
  "summary" : "Lemur: LDAP Filter Injection enables post-authentication privilege escalation",
  "details" : "## Description\n\n### Overview\n\nLemur'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.\n\n### Vulnerable Code\n\n**Location:** `lemur/auth/ldap.py`, `_bind()` method\n\n**Filter 1 — User lookup (line ~161):**\n```python\nldap_filter = \"userPrincipalName=%s\" % self.ldap_principal\n```\n\n`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.\n\n**Filter 2 — Active Directory group lookup (line ~189):**\n```python\ngroupfilter = \"(&(objectclass=group)(member:1.2.840.113556.1.4.1941:={}))\".format(userdn)\n```\n\nThe `userdn` value is derived from the LDAP response to the first unsanitized query, making it potentially tainted as well.\n\n### Impact\n\nAn authenticated LDAP user can:\n\n1. Inject LDAP filter syntax into the username field during login\n2. Manipulate the group membership query to return arbitrary groups\n3. Be assigned the `admin` role or any other privileged role in Lemur\n4. Gain unauthorized access to all certificates, private keys (via `/certificates/<id>/key`), and CA configurations\n5. Issue certificates under any authority\n\n### Exploitation Constraint\n\nThe `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**.\n\n### Steps to Reproduce\n\n1. Deploy Lemur with LDAP authentication enabled:\n   ```python\n   LDAP_AUTH = True\n   LDAP_IS_ACTIVE_DIRECTORY = True\n   LDAP_BIND_URI = \"ldaps://dc.corp.example.com\"\n   LDAP_BASE_DN = \"DC=corp,DC=example,DC=com\"\n   LDAP_EMAIL_DOMAIN = \"corp.example.com\"\n   ```\n2. Create a valid LDAP user account\n3. Send login request with crafted username containing LDAP metacharacters:\n   ```\n   POST /auth/login\n   Content-Type: application/json\n\n   {\n     \"username\": \"validuser)(memberOf=CN=LemurAdmins,DC=corp,DC=example,DC=com\",\n     \"password\": \"validpassword\"\n   }\n   ```\n4. The LDAP filter becomes:\n   ```\n   userPrincipalName=validuser)(memberOf=CN=LemurAdmins,DC=corp,DC=example,DC=com@corp.example.com\n   ```\n5. Depending on the LDAP server's parsing, this can alter query semantics\n6. The user is assigned roles they should not have access to\n\n### Remediation\n\nApply `ldap.filter.escape_filter_chars()` to all user-controlled values before interpolation:\n\n```python\nfrom ldap.filter import escape_filter_chars\n\n# Fix 1: User lookup filter\nldap_filter = \"userPrincipalName=%s\" % escape_filter_chars(self.ldap_principal)\n\n# Fix 2: Active Directory group filter\ngroupfilter = \"(&(objectclass=group)(member:1.2.840.113556.1.4.1941:={}))\".format(\n    escape_filter_chars(userdn)\n)\n```\n\n### Resources\n\n- CWE-90: https://cwe.mitre.org/data/definitions/90.html\n- OWASP LDAP Injection: https://owasp.org/www-community/attacks/LDAP_Injection\n- Python ldap.filter.escape_filter_chars: https://www.python-ldap.org/en/python-ldap-3.4.0/reference/ldap-filter.html",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "lemur"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.9.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/Netflix/lemur/security/advisories/GHSA-3r34-vq8m-39gh"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-44304"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/Netflix/lemur"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Netflix/lemur/releases/tag/v1.9.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-90" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-05-06T19:16:59Z",
    "nvd_published_at" : "2026-05-12T22:16:37Z"
  }
}