python-ldap has sanitization bypass in ldap.filter.escape_filter_chars
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Attack requirements
- None
- Impact type
- —
- Confidentiality · integrity · availability
- Low · Low · None
- Fix status
- Partial Red Hat: 9 without a fix
Attack profile from CVSS 4.0 · CNA. Fix status from CNA, GitHub and Red Hat.
Summary
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`.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| python-ldap | python-ldap | before 3.4.5 | 3.4.5 | Patch available | CNA |
| — | python-ldap (PyPI) | before 3.4.5 | 3.4.5 | Patch available | GHSA-r7r6-cc7p-4v5m |
- python-ldap Vendorpython-ldap Affected before 3.4.5 Fixed in 3.4.5 Patch available CNA
- python-ldap (PyPI) Vendor— Affected before 3.4.5 Fixed in 3.4.5 Patch available GHSA-r7r6-cc7p-4v5m
CPE configurations NVD · 1
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:python-ldap:python-ldap:*:*:*:*:*:*:*:* | before 3.4.5 | Vulnerable | python-ldap |
- cpe:2.3:a:python-ldap:python-ldap:*:*:*:*:*:*:*:* Versions before 3.4.5 Vulnerable ·python-ldap
Remediation
- Fix · CNA python-ldap (python-ldap) Fixed in 3.4.5
- Fix · GHSA-r7r6-cc7p-4v5m python-ldap (PyPI) Fixed in 3.4.5 Advisory →
Vendor assessments
Red Hat
Red Hat rating: Moderate. Red Hat's page for this CVE →
| Product | Status | Plan or fix |
|---|---|---|
| Red Hat Ansible Automation Platform 2 | Affected | No fix yet: Fix deferred |
| Red Hat Enterprise Linux 10 | Affected | No fix yet: Fix deferred |
| Red Hat Enterprise Linux 6 | Affected | No fix planned: Out of support scope |
| Red Hat Enterprise Linux 7 | Affected | No fix planned: Out of support scope |
| Red Hat Enterprise Linux 8 | Affected | No fix planned: Out of support scope |
| Red Hat Enterprise Linux 9 | Affected | No fix yet: Fix deferred |
| Red Hat OpenStack Platform 13 (Queens) | Affected | No fix planned: Out of support scope |
| Red Hat Quay 3 | Affected | No fix yet: Fix deferred |
| Red Hat Satellite 6 | Affected | No fix yet: Fix deferred |
Timeline
- 2026-10-02 Threatist record created from CVE-2025-61911
- 2026-10-03 Alias added: GHSA-r7r6-cc7p-4v5m
References
More Python-ldap vulnerabilities
- TI-2025-38262 python-ldap Vulnerable to Improper Encoding or Escaping of Output and Improper Null Termination CVSS 4.0MEDIUM 5.5
- TI-2021-21516 python-ldap before 3.4.0 is vulnerable to a denial of service when ldap.schema is used… CVSS 3.1MEDIUM 6.5
Sources
- CVE-2025-61911 · CVE Program
- CVE-2025-61911 · NVD
- FIRST EPSS
- GHSA-r7r6-cc7p-4v5m · GitHub Advisory Database · CC BY 4.0
- CVE-2025-61911 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences