# CVE-2025-61911: python-ldap has sanitization bypass in ldap.filter.escape\_filter\_chars

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 5.5
- **CVSS:** 5.5 (v4.0, CNA) `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`
- **CVSS metrics:** Attack vector: Network; Attack complexity: Low; Attack requirements: None; Privileges required: None; User interaction: None; Confidentiality impact: Low; Integrity impact: Low; Availability impact: None; Confidentiality impact on other systems: None; Integrity impact on other systems: None; Availability impact on other systems: None; Exploit maturity: Proof of concept
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Remote, no login needed
- **EPSS:** 0.50% (percentile 36, 2026-11-29)
- **CWE:** CWE-75, CWE-843
- **Aliases:** GHSA-r7r6-cc7p-4v5m, PYSEC-2026-1847
- **Published:** 2025-10-10T22:02:15.529Z
- **Modified:** 2026-10-19T16:10:00.260Z

## Who should check

- Projects that depend on PyPI package python-ldap (\< 3.4.5)
- Anyone running python-ldap \< 3.4.5

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

## Affected and fixed versions

- PyPI `python-ldap`: affected \< 3.4.5; fixed 3.4.5 (osv)
- python-ldap: \< 3.4.5 (cvelist)

## Mitigation

- Upgrade python-ldap to 3.4.5 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2025-61911. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2025-61911.md
Affected: python-ldap < 3.4.5
Fixed in: 3.4.5

Steps:
1. Search this machine and project for python-ldap (PyPI), python-ldap: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2025-61911 being exploited?

There is no confirmed exploitation: CVE-2025-61911 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.50% chance of exploitation in the next 30 days (as of 2026-11-29).

### How serious is CVE-2025-61911?

Medium: CVSS 5.5 (v4.0, scored by CNA). Remote, no login needed.

### Which versions are affected by CVE-2025-61911?

python-ldap \< 3.4.5.

### Is there a fix for CVE-2025-61911?

Yes. Fixed in 3.4.5. Upgrade python-ldap to 3.4.5 or later.

### How do I check if I'm affected by CVE-2025-61911?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- vendor: <https://github.com/python-ldap/python-ldap/security/advisories/GHSA-r7r6-cc7p-4v5m>
- vendor: <https://nvd.nist.gov/vuln/detail/CVE-2025-61911>
- vendor: <https://github.com/advisories/GHSA-r7r6-cc7p-4v5m>
- patch: <https://github.com/python-ldap/python-ldap/commit/3957526fb1852e84b90f423d9fef34c7af25b85a>
- other: <https://github.com/python-ldap/python-ldap/releases/tag/python-ldap-3.4.5>
- other: <https://github.com/python-ldap/python-ldap>
- other: <https://pypi.org/project/python-ldap>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2025-61911>
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/GHSA-r7r6-cc7p-4v5m> (license: <https://creativecommons.org/licenses/by/4.0/>)
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/PYSEC-2026-1847> (license: <https://creativecommons.org/licenses/by/4.0/>)

HTML: <https://flawdb.com/CVE-2025-61911> · JSON: <https://flawdb.com/api/v1/entries/CVE-2025-61911>
