p PatchFirst

CVE-2025-61911

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

This page contains facts from public vulnerability sources. Check the original advisory before updating.

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

CVSS 5.5 · Medium · EPSS 0.3% · Fix available

Published
Updated

Stack: system · python

Affected products and versions

  • python-ldap

    Versions
    • < 3.4.5: Affected

    No fix published

  • python-ldap Debian:12

    Versions
    • 3.4.3-2
    Affected ranges
    • ECOSYSTEM: < 3.4.3-2+deb12u1

    Update to 3.4.3-2+deb12u1

  • python-ldap Debian:13

    Versions
    • 3.4.4-1
    Affected ranges
    • ECOSYSTEM: < 3.4.4-1+deb13u1

    Update to 3.4.4-1+deb13u1

  • python-ldap Debian:14

    Versions
    • 3.4.4-1
    • 3.4.4-2
    Affected ranges
    • ECOSYSTEM: < 3.4.5-1

    Update to 3.4.5-1

  • python-ldap PyPI

    Versions
    • 2.3.13
    • 2.4.0
    • 2.4.1
    • 2.4.10
    • 2.4.12
    • 2.4.13
    • 2.4.14
    • 2.4.15
    • 2.4.16
    • 2.4.17
    • 2.4.18
    • 2.4.19
    • 2.4.2
    • 2.4.20
    • 2.4.21
    • 2.4.22
    • 2.4.25
    • 2.4.26
    • 2.4.27
    • 2.4.28
    • 2.4.29
    • 2.4.3
    • 2.4.30
    • 2.4.31
    • 2.4.32
    • 2.4.33
    • 2.4.35
    • 2.4.36
    • 2.4.37
    • 2.4.38
    • 2.4.39
    • 2.4.4
    • 2.4.40
    • 2.4.41
    • 2.4.42
    • 2.4.43
    • 2.4.44
    • 2.4.45
    • 2.4.5
    • 2.4.6
    • 2.4.7
    • 2.4.8
    • 2.4.9
    • 2.5.1
    • 2.5.2
    • 3.0.0
    • 3.0.0b1
    • 3.0.0b2
    • 3.0.0b3
    • 3.0.0b4
    • 3.1.0
    • 3.2.0
    • 3.3.0
    • 3.3.1
    • 3.4.0
    • 3.4.2
    • 3.4.3
    • 3.4.4
    Affected ranges
    • ECOSYSTEM: < 3.4.5

    Update to 3.4.5

  • python-ldap Ubuntu:Pro:16.04:LTS

    Versions
    • 2.4.20-0.1
    • 2.4.22-0.1
    Affected ranges
    • ECOSYSTEM: < 2.4.22-0.1ubuntu0.1~esm1

    Update to 2.4.22-0.1ubuntu0.1~esm1

  • python-ldap Ubuntu:Pro:18.04:LTS

    Versions
    • 2.4.41-1
    • 2.5.2-1
    • 3.0.0~b4-1
    • 3.0.0-1
    • 3.0.0-1ubuntu0.1
    • 3.0.0-1ubuntu0.2
    Affected ranges
    • ECOSYSTEM: < 3.0.0-1ubuntu0.2+esm1

    Update to 3.0.0-1ubuntu0.2+esm1

  • python-ldap Ubuntu:Pro:20.04:LTS

    Versions
    • 3.1.0-2build1
    • 3.1.0-2build2
    • 3.2.0-3
    • 3.2.0-3ubuntu1
    • 3.2.0-3ubuntu2
    • 3.2.0-3ubuntu3
    • 3.2.0-4ubuntu2
    • 3.2.0-4ubuntu2.1
    Affected ranges
    • ECOSYSTEM: < 3.2.0-4ubuntu2.1+esm1

    Update to 3.2.0-4ubuntu2.1+esm1

  • python-ldap Ubuntu:22.04:LTS

    Versions
    • 3.2.0-4ubuntu5
    • 3.2.0-4ubuntu6
    • 3.2.0-4ubuntu7
    • 3.2.0-4ubuntu7.1
    Affected ranges
    • ECOSYSTEM: < 3.2.0-4ubuntu7.2

    Update to 3.2.0-4ubuntu7.2

  • python-ldap Ubuntu:24.04:LTS

    Versions
    • 3.4.3-2build2
    • 3.4.3-2build3
    • 3.4.3-2ubuntu1
    • 3.4.4-1
    • 3.4.4-1build1
    Affected ranges
    • ECOSYSTEM: < 3.4.4-1ubuntu0.24.04.1

    Update to 3.4.4-1ubuntu0.24.04.1

  • python-ldap Ubuntu:25.10

    Versions
    • 3.4.4-1build3
    Affected ranges
    • ECOSYSTEM: < 3.4.4-1ubuntu0.25.10.1

    Update to 3.4.4-1ubuntu0.25.10.1

Original sources

Check your server →