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

Medium 5.5 Published Updated

Attackers can bypass LDAP filter sanitization in python-ldap to inject queries and access or modify unauthorized directory data.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2025-61911?

CVE-2025-61911 is a medium-severity vulnerability in python-ldap, published on 10 Oct 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

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`.

Weakness: CWE-843, CWE-75

Which versions are affected by CVE-2025-61911?

3 open source packages ship an affected version, including python-ldap. It affects 1 product.

PackageAffectedFixed in
python-ldap PyPIAll versions3.4.5
python-ldap PyPIAll versions3.4.5
python-ldap PyPIAll versions3.4.5

Products include Python-Ldap Python-Ldap.

How do I fix CVE-2025-61911?

Upgrade python-ldap to 3.4.5 or later.

Is CVE-2025-61911 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-61911 exists.

Sources

Also known as AZL-68430, AZL-68451, DEBIAN-CVE-2025-61911, ECHO-f6d8-9d6f-c927, GHSA-r7r6-cc7p-4v5m, OESA-2025-2683 and 2 more.

Is CVE-2025-61911 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free