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.

Severity (CVSS 4.0)5.5Medium
Exploit odds (30 days)0.3%top 74.9% of all CVEs
Exploited in the wildNo reportsCISA SSVC: poc
Attack toolingNoneno public tooling known

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

EcosystemPackageFixed inAdvisory
Alpine:v3.24py3-ldap3.4.5-r0ALPINE-CVE-2025-61911
Debian:12python-ldap3.4.3-2+deb12u1DEBIAN-CVE-2025-61911
Debian:13python-ldap3.4.4-1+deb13u1DEBIAN-CVE-2025-61911
Debian:14python-ldap3.4.5-1DEBIAN-CVE-2025-61911
PyPIpython-ldap3.4.5GHSA-r7r6-cc7p-4v5m
PyPIpython-ldap3.4.5PYSEC-2026-1847
Ubuntu:22.04:LTSpython-ldap3.2.0-4ubuntu7.2USN-7828-1
Ubuntu:22.04:LTSpython-ldap3.2.0-4ubuntu7.2UBUNTU-CVE-2025-61911
Ubuntu:24.04:LTSpython-ldap3.4.4-1ubuntu0.24.04.1USN-7828-1
Ubuntu:24.04:LTSpython-ldap3.4.4-1ubuntu0.24.04.1UBUNTU-CVE-2025-61911
Ubuntu:25.10python-ldap3.4.4-1ubuntu0.25.10.1UBUNTU-CVE-2025-61911
Ubuntu:25.10python-ldap3.4.4-1ubuntu0.25.10.1USN-7828-1

Affected products (as reported)

VendorProductVersions
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

References