Vulnerability · Published Oct 10, 2025 · Assigned by GitHub_M
CVE-2025-61911python-ldap has sanitization bypass in ldap.filter.escape_filter_chars
Medium 5.5
In plain English
A medium-severity type confusion in python-ldap from python-ldap. Proof-of-concept exploit code is public. The chance it is exploited in the next 30 days is estimated at 0.3% (higher than 25% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official 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 packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine:v3.24 | py3-ldap | 3.4.5-r0 | ALPINE-CVE-2025-61911 |
| Debian:12 | python-ldap | 3.4.3-2+deb12u1 | DEBIAN-CVE-2025-61911 |
| Debian:13 | python-ldap | 3.4.4-1+deb13u1 | DEBIAN-CVE-2025-61911 |
| Debian:14 | python-ldap | 3.4.5-1 | DEBIAN-CVE-2025-61911 |
| PyPI | python-ldap | 3.4.5 | GHSA-r7r6-cc7p-4v5m |
| PyPI | python-ldap | 3.4.5 | PYSEC-2026-1847 |
| Ubuntu:22.04:LTS | python-ldap | 3.2.0-4ubuntu7.2 | USN-7828-1 |
| Ubuntu:22.04:LTS | python-ldap | 3.2.0-4ubuntu7.2 | UBUNTU-CVE-2025-61911 |
| Ubuntu:24.04:LTS | python-ldap | 3.4.4-1ubuntu0.24.04.1 | USN-7828-1 |
| Ubuntu:24.04:LTS | python-ldap | 3.4.4-1ubuntu0.24.04.1 | UBUNTU-CVE-2025-61911 |
| Ubuntu:25.10 | python-ldap | 3.4.4-1ubuntu0.25.10.1 | UBUNTU-CVE-2025-61911 |
| Ubuntu:25.10 | python-ldap | 3.4.4-1ubuntu0.25.10.1 | USN-7828-1 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| python-ldap | python-ldap | < 3.4.5 |
Weakness: CWE-75, CWE-843 · Vector: CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N/E:P