Skip to content

CVE-2025-61911 python-ldap has sanitization bypass in ldap.filter.escape_filter_chars

MediumCVSS 5.5 EPSS 0.32%
Published
Updated
Exploit status
No public exploit known
CISA SSVC
Proof of concept public · automatable: no · technical impact: partial
Technology
UbuntuDebian

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.

Upgrade path

8 packages: 8 fixed.

PackageAffectedFixed inStatus
alpine/py3-ldap(Alpine v3.24) < 3.4.5-r0 3.4.5-r0 Fixed
debian/python-ldap(Debian 12) < 3.4.3-2+deb12u1; = 3.4.3-2 3.4.3-2+deb12u1 Fixed
debian/python-ldap(Debian 13) < 3.4.4-1+deb13u1; = 3.4.4-1 3.4.4-1+deb13u1 Fixed
debian/python-ldap(Debian 14) < 3.4.5-1; = 3.4.4-1; = 3.4.4-2 3.4.5-1 Fixed
pypi python-ldap(PyPI) < 3.4.5; = 2.3.13; = 2.4.0; = 2.4.1 +55 more 3.4.5 Fixed
python-ldap < 3.4.5; = < 3.4.5 3.4.5 Fixed
ubuntu/python-ldap(Ubuntu 22.04) < 3.2.0-4ubuntu7.2 3.2.0-4ubuntu7.2 Fixed
ubuntu/python-ldap(Ubuntu 24.04) < 3.4.4-1ubuntu0.24.04.1 3.4.4-1ubuntu0.24.04.1 Fixed

Affected products

ProductAffected versionsFixed in
pypi python-ldap(PyPI) < 3.4.5 3.4.5
pypi python-ldap(PyPI) = 2.3.13 No fix listed
pypi python-ldap(PyPI) = 2.4.0 No fix listed
pypi python-ldap(PyPI) = 2.4.1 No fix listed
pypi python-ldap(PyPI) = 2.4.10 No fix listed
pypi python-ldap(PyPI) = 2.4.12 No fix listed
pypi python-ldap(PyPI) = 2.4.13 No fix listed
pypi python-ldap(PyPI) = 2.4.14 No fix listed
pypi python-ldap(PyPI) = 2.4.15 No fix listed
pypi python-ldap(PyPI) = 2.4.16 No fix listed
pypi python-ldap(PyPI) = 2.4.17 No fix listed
pypi python-ldap(PyPI) = 2.4.18 No fix listed
pypi python-ldap(PyPI) = 2.4.19 No fix listed
pypi python-ldap(PyPI) = 2.4.2 No fix listed
pypi python-ldap(PyPI) = 2.4.20 No fix listed
pypi python-ldap(PyPI) = 2.4.21 No fix listed
pypi python-ldap(PyPI) = 2.4.22 No fix listed
pypi python-ldap(PyPI) = 2.4.25 No fix listed
pypi python-ldap(PyPI) = 2.4.26 No fix listed
pypi python-ldap(PyPI) = 2.4.27 No fix listed
pypi python-ldap(PyPI) = 2.4.28 No fix listed
pypi python-ldap(PyPI) = 2.4.29 No fix listed
pypi python-ldap(PyPI) = 2.4.3 No fix listed
pypi python-ldap(PyPI) = 2.4.30 No fix listed
pypi python-ldap(PyPI) = 2.4.31 No fix listed
Show 46 more
ProductAffected versionsFixed in
pypi python-ldap(PyPI) = 2.4.32 No fix listed
pypi python-ldap(PyPI) = 2.4.33 No fix listed
pypi python-ldap(PyPI) = 2.4.35 No fix listed
pypi python-ldap(PyPI) = 2.4.36 No fix listed
pypi python-ldap(PyPI) = 2.4.37 No fix listed
pypi python-ldap(PyPI) = 2.4.38 No fix listed
pypi python-ldap(PyPI) = 2.4.39 No fix listed
pypi python-ldap(PyPI) = 2.4.4 No fix listed
pypi python-ldap(PyPI) = 2.4.40 No fix listed
pypi python-ldap(PyPI) = 2.4.41 No fix listed
pypi python-ldap(PyPI) = 2.4.42 No fix listed
pypi python-ldap(PyPI) = 2.4.43 No fix listed
pypi python-ldap(PyPI) = 2.4.44 No fix listed
pypi python-ldap(PyPI) = 2.4.45 No fix listed
pypi python-ldap(PyPI) = 2.4.5 No fix listed
pypi python-ldap(PyPI) = 2.4.6 No fix listed
pypi python-ldap(PyPI) = 2.4.7 No fix listed
pypi python-ldap(PyPI) = 2.4.8 No fix listed
pypi python-ldap(PyPI) = 2.4.9 No fix listed
pypi python-ldap(PyPI) = 2.5.1 No fix listed
pypi python-ldap(PyPI) = 2.5.2 No fix listed
pypi python-ldap(PyPI) = 3.0.0 No fix listed
pypi python-ldap(PyPI) = 3.0.0b1 No fix listed
pypi python-ldap(PyPI) = 3.0.0b2 No fix listed
pypi python-ldap(PyPI) = 3.0.0b3 No fix listed
pypi python-ldap(PyPI) = 3.0.0b4 No fix listed
pypi python-ldap(PyPI) = 3.1.0 No fix listed
pypi python-ldap(PyPI) = 3.2.0 No fix listed
pypi python-ldap(PyPI) = 3.3.0 No fix listed
pypi python-ldap(PyPI) = 3.3.1 No fix listed
pypi python-ldap(PyPI) = 3.4.0 No fix listed
pypi python-ldap(PyPI) = 3.4.2 No fix listed
pypi python-ldap(PyPI) = 3.4.3 No fix listed
pypi python-ldap(PyPI) = 3.4.4 No fix listed
debian/python-ldap(Debian:12) < 3.4.3-2+deb12u1 3.4.3-2+deb12u1
debian/python-ldap(Debian:12) = 3.4.3-2 No fix listed
debian/python-ldap(Debian:13) < 3.4.4-1+deb13u1 3.4.4-1+deb13u1
debian/python-ldap(Debian:13) = 3.4.4-1 No fix listed
debian/python-ldap(Debian:14) < 3.4.5-1 3.4.5-1
debian/python-ldap(Debian:14) = 3.4.4-1 No fix listed
debian/python-ldap(Debian:14) = 3.4.4-2 No fix listed
python-ldap = < 3.4.5 No fix listed
ubuntu/python-ldap(Ubuntu:22.04) < 3.2.0-4ubuntu7.2 3.2.0-4ubuntu7.2
alpine/py3-ldap(Alpine:v3.24) < 3.4.5-r0 3.4.5-r0
ubuntu/python-ldap(Ubuntu:24.04) < 3.4.4-1ubuntu0.24.04.1 3.4.4-1ubuntu0.24.04.1
python-ldap < 3.4.5 3.4.5

References