CVE-2025-61911python-ldap has sanitization bypass in ldap.filter.escape_filter_chars
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`.
What to do
Fixed builds are available from Alpine, Debian, PyPI, Ubuntu: see the table below for the fixed version per release.
Red Hat, Ubuntu have not shipped a fix for every release yet.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 25.10 | python-ldap | Fixed | 3.4.4-1ubuntu0.25.10.1 | UBUNTU-CVE-2025-61911 |
| Ubuntu 24.04 | python-ldap | Fixed | 3.4.4-1ubuntu0.24.04.1 | UBUNTU-CVE-2025-61911 |
| Ubuntu 22.04 | python-ldap | Fixed | 3.2.0-4ubuntu7.2 | UBUNTU-CVE-2025-61911 |
| Ubuntu 20.04 | python-ldap | Fix pending | 3.2.0-4ubuntu2.1+esm1 (Ubuntu Pro) | UBUNTU-CVE-2025-61911 |
| Ubuntu 18.04 | python-ldap | Fix pending | 3.0.0-1ubuntu0.2+esm1 (Ubuntu Pro) | UBUNTU-CVE-2025-61911 |
| Ubuntu 16.04 | python-ldap | Fix pending | 2.4.22-0.1ubuntu0.1~esm1 (Ubuntu Pro) | UBUNTU-CVE-2025-61911 |
| Debian 14 | python-ldap | Fixed | 3.4.5-1 | DEBIAN-CVE-2025-61911 |
| Debian 13 | python-ldap | Fixed | 3.4.4-1+deb13u1 | DEBIAN-CVE-2025-61911 |
| Debian 12 | python-ldap | Fixed | 3.4.3-2+deb12u1 | DEBIAN-CVE-2025-61911 |
| Red Hat Enterprise Linux 10 | python3-ldap | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 9 | python3-ldap | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | python3-ldap | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | python-ldap | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | python-ldap | Will not fix Out of support scope | ||
| Alpine Linux 3.24 | py3-ldap | Fixed | 3.4.5-r0 | ALPINE-CVE-2025-61911 |
| PyPI library | python-ldap | Fixed | 3.4.5 | PYSEC-2026-1847 |
What the vendor says
As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- python-ldap: affected: < 3.4.5
References
- https://github.com/python-ldap/python-ldap/security/advisories/GHSA-r7r6-cc7p-4v5m
- https://github.com/python-ldap/python-ldap/commit/3957526fb1852e84b90f423d9fef34c7af25b85a
- https://github.com/python-ldap/python-ldap/releases/tag/python-ldap-3.4.5
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.