{"id":"CVE-2025-61911","published":"2025-10-10T22:02:15Z","modified":"2025-10-14T14:57:34Z","title":"python-ldap has sanitization bypass in ldap.filter.escape_filter_chars","vendor":"python-ldap","product":"python-ldap","tier":"tail","description":{"text":"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`.","provenance":"source","from":"CVE.org"},"cvss":{"score":5.5,"severity":"MEDIUM","version":"4.0","vector":"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","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00499,"percentile":0.35734,"provenance":"source"},"cwes":[{"id":"CWE-75","name":"Failure to Sanitize Special Elements into a Different Plane"},{"id":"CWE-843","name":"Access of Resource Using Incompatible Type"}],"references":[{"url":"https://github.com/python-ldap/python-ldap/security/advisories/GHSA-r7r6-cc7p-4v5m","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/python-ldap/python-ldap/commit/3957526fb1852e84b90f423d9fef34c7af25b85a","tags":["x_refsource_MISC"]},{"url":"https://github.com/python-ldap/python-ldap/releases/tag/python-ldap-3.4.5","tags":["x_refsource_MISC"]}],"priority":{"score":11.0,"factors":[{"name":"EPSS percentile","points":7.15},{"name":"CVSS severity","points":3.85}]},"vendorSlug":"python-ldap","affectedVersions":[{"vendor":"python-ldap","product":"python-ldap","versions":["< 3.4.5"]}],"ssvc":{"exploitation":"poc","automatable":"no","technicalImpact":"partial","timestamp":"2025-10-14T14:57:26.403796Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"PyPI","package":"python-ldap","vulnerableRanges":["<3.4.5"],"patched":["3.4.5"],"from":["GHSA-r7r6-cc7p-4v5m","PYSEC-2026-1847"],"provenance":"source"}],"summary":{"text":"The python-ldap library's ldap.filter.escape_filter_chars function, prior to version 3.4.5, fails to fully escape special characters when a list or dict is passed as assertion_value and the non-default escape_mode=1 is set. An attacker who can supply such input to an application relying on this function for escaping could perform LDAP injection to disclose or manipulate directory data, with network access and no authentication or user interaction required, provided the application uses this configuration.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T22:09:39Z"},"euvd":{"id":"EUVD-2025-33797","exploited":false,"provenance":"source"}}