Description
python-ldap is a lightweight directory access protocol (LDAP) client API for Python. In versions prior to 3.4.5, the sanitization method `ldap.filter.escape_filter_chars` can be tricked to skip escaping of special characters when a crafted `list` or `dict` is supplied as the `assertion_value` parameter, and the non-default `escape_mode=1` is configured. The method `ldap.filter.escape_filter_chars` supports 3 different escaping modes. `escape_mode=0` (default) and `escape_mode=2` happen to raise exceptions when a `list` or `dict` object is supplied as the `assertion_value` parameter. However, `escape_mode=1` computes without performing adequate logic to ensure a fully escaped return value. If an application relies on the vulnerable method in the `python-ldap` library to escape untrusted user input, an attacker might be able to abuse the vulnerability to launch ldap injection attacks which could potentially disclose or manipulate ldap data meant to be inaccessible to them. Version 3.4.5 fixes the issue by adding a type check at the start of the `ldap.filter.escape_filter_chars` method to raise an exception when the supplied `assertion_value` parameter is not of type `str`.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| python-ldap | python-ldap | < 3.4.5 | — |
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | python-ldap | 3.4.5-1 | — |
| Debian 13 | python-ldap | 3.4.4-1+deb13u1 | — |
| Debian 12 | python-ldap | 3.4.3-2+deb12u1 | — |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 25.10 | python-ldap | 3.4.4-1ubuntu0.25.10.1 | USN-7828-1 |
| Ubuntu 24.04 LTS | python-ldap | 3.4.4-1ubuntu0.24.04.1 | USN-7828-1 |
| Ubuntu 22.04 LTS | python-ldap | 3.2.0-4ubuntu7.2 | USN-7828-1 |
Show 3 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu Pro 20.04 LTS | python-ldap | 3.2.0-4ubuntu2.1+esm1 | USN-7828-1 |
| Ubuntu Pro 18.04 LTS | python-ldap | 3.0.0-1ubuntu0.2+esm1 | USN-7828-1 |
| Ubuntu Pro 16.04 LTS | python-ldap | 2.4.22-0.1ubuntu0.1~esm1 | USN-7828-1 |
SUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| SLES 15 SP6 | python-ldap | 3.1.0-150100.3.5.1 | SUSE-SU-2025:3714-1, SUSE-SU-2025:3695-1 |
Show 2 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| SLES for SAP 16.0 | python-ldap | 3.4.4-160000.3.1 | SUSE-SU-2026:20933-1 |
| SLES 16.0 | python-ldap | 3.4.4-160000.3.1 | SUSE-SU-2026:20933-1 |
openSUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| openSUSE Tumbleweed | python-ldap | 3.4.5-1.1 | openSUSE-SU-2025:15637-1 |
| openSUSE Leap 16.0 | python-ldap | 3.4.4-160000.3.1 | openSUSE-SU-2026:20421-1 |
| openSUSE Leap 15.6 | python-ldap | 3.4.0-150400.3.3.1 | SUSE-SU-2025:3714-1 |
Alpine
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine v3.24 | py3-ldap | 3.4.5-r0 | — |
Amazon Linux
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Amazon Linux 2 | python-ldap | 2.4.15-2.amzn2.0.7 | ALAS2-2025-3083 |
Azure Linux
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Azure Linux 3 | python-ldap | No fix yet | — |
| Azure Linux 2 (CBL-Mariner) | python-ldap | No fix yet | — |
Affected packages
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| PyPI | python-ldap | < 3.4.5 | 3.4.5 | GHSA-r7r6-cc7p-4v5m |
Advisories 8
- WID-SEC-2026-1730 Xerox FreeFlow Print Server: Mehrere Schwachstellen ermöglichen nicht spezifizierten Angriff BSI CERT-Bund (WID) · Jul 16, 2026
- USN-7828-1 python-ldap vulnerabilities Ubuntu Security Notices (USN) · Jun 25, 2026
- SUSE-SU-2026:20933-1 Security update for python-ldap SUSE / openSUSE Security Updates · Apr 2, 2026
- openSUSE-SU-2026:20421-1 Security update for python-ldap SUSE / openSUSE Security Updates · Mar 29, 2026
- openSUSE-SU-2025:15637-1 python311-ldap-3.4.5-1.1 on GA media SUSE / openSUSE Security Updates · Mar 23, 2026
- SUSE-SU-2025:3714-1 Security update for python-ldap SUSE / openSUSE Security Updates · Feb 4, 2026
- SUSE-SU-2025:3695-1 Security update for python-ldap SUSE / openSUSE Security Updates · Feb 4, 2026
- ALAS2-2025-3083 Moderate: python-ldap security update (Amazon Linux 2) Amazon Linux Security Center (ALAS) · Dec 8, 2025