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

- Severity: Medium 5.5 (CVSS:4.0, scored by GitHub_M) `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`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.34%, higher than 29% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2025-10-10T22:02:15.529Z
- Modified: 2026-10-19T16:10:00.260Z
- Also known as: GHSA-r7r6-cc7p-4v5m, PYSEC-2026-1847
- Weaknesses: CWE-75, CWE-843
- SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial
- Assigned by: GitHub_M

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

(As written by CVE List.)

## Affected

- python-ldap python-ldap: < 3.4.5; before 3.4.5
- python-ldap (PyPI): before 3.4.5

## Every score

- GitHub_M: CVSS:4.0 5.5 Medium `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`
- GitHub: CVSS:4.0 Medium `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`
- NVD: CVSS:3.1 6.5 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N`
- PyPA Advisory Database: CVSS:4.0 `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

- <https://github.com/python-ldap/python-ldap/security/advisories/GHSA-r7r6-cc7p-4v5m> (exploit, mitigation, third-party-advisory, web)
- <https://github.com/python-ldap/python-ldap/commit/3957526fb1852e84b90f423d9fef34c7af25b85a> (patch, web)
- <https://github.com/python-ldap/python-ldap/releases/tag/python-ldap-3.4.5> (release-notes, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2025-61911> (advisory)
- <https://github.com/python-ldap/python-ldap> (package)
- <https://pypi.org/project/python-ldap> (package)
- <https://github.com/advisories/GHSA-r7r6-cc7p-4v5m> (advisory)

## Sources

- CVE List: [CVE-2025-61911](https://www.cve.org/CVERecord?id=CVE-2025-61911), CVE Terms of Use, modified 2025-10-14
- GitHub Advisory Database: [GHSA-r7r6-cc7p-4v5m](https://github.com/advisories/GHSA-r7r6-cc7p-4v5m), CC-BY-4.0, modified 2026-09-10
- NVD: [CVE-2025-61911](https://nvd.nist.gov/vuln/detail/CVE-2025-61911), Public domain, modified 2026-10-19
- PyPA Advisory Database: [PYSEC-2026-1847](https://osv.dev/vulnerability/PYSEC-2026-1847), CC-BY-4.0, modified 2026-07-07

---

Page: https://cve.day/CVE-2025-61911 · Whole record: https://cve.day/CVE-2025-61911.json · Rebuilt by cve.day 2026-11-25T22:59:05.779Z
