CVE-2025-61911: python-ldap has sanitization bypass in ldap.filter.escape_filter_chars
N/A
CVSS Score
Basic Information
CVE ID
GHSA ID
EPSS Score
-
CWE
Published
10/10/2025
Updated
10/10/2025
KEV Status
No
Technology
Python
Technical Details
CVSS Vector
-
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| python-ldap | pip | < 3.4.5 | 3.4.5 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability lies in the ldap.filter.escape_filter_chars function, which fails to properly sanitize input when it's a list or dictionary and escape_mode is set to 1. The provided security advisory and commit patch directly point to this function as the source of the vulnerability. The patch adds a type check to ensure the input is a string, thus preventing the type confusion that leads to the sanitization bypass. The evidence from the commit 3957526fb1852e84b90f423d9fef34c7af25b85a clearly shows the addition of this type check in Lib/ldap/filter.py as the fix. Therefore, escape_filter_chars is the function that would appear in a runtime profile during the exploitation of this vulnerability.
Vulnerable functions
escape_filter_charsLib/ldap/filter.py
The function `escape_filter_chars` in the `ldap.filter` module is vulnerable to a sanitization bypass. When `escape_mode=1` is configured, and the `assertion_value` parameter is a list or a dictionary instead of a string, the function fails to escape special LDAP filter characters. This allows an attacker to inject malicious filter strings, potentially leading to an LDAP injection attack. The patch mitigates this by adding a type check at the beginning of the function to ensure that the `assertion_value` is a string.