Update dependency python-ldap to v3.4.5 [SECURITY] - autoclosed#296
Closed
redhat-renovate-bot wants to merge 1 commit intomainfrom
Closed
Update dependency python-ldap to v3.4.5 [SECURITY] - autoclosed#296redhat-renovate-bot wants to merge 1 commit intomainfrom
redhat-renovate-bot wants to merge 1 commit intomainfrom
Conversation
Signed-off-by: redhat-renovate-bot <redhat-internal-renovate@redhat.com>
9e80bbb to
d0bd6ce
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
==3.4.4->==3.4.5GitHub Vulnerability Alerts
CVE-2025-61911
Summary
The sanitization method
ldap.filter.escape_filter_charscan be tricked to skip escaping of special characters when a craftedlistordictis supplied as theassertion_valueparameter, and the non-defaultescape_mode=1is configured.Details
The method
ldap.filter.escape_filter_charssupports 3 different escaping modes.escape_mode=0(default) andescape_mode=2happen to raise exceptions when alistordictobject is supplied as theassertion_valueparameter. However,escape_mode=1happily computes without performing adequate logic to ensure a fully escaped return value.PoC
Exploitable
Not exploitable
Impact
If an application relies on the vulnerable method in the
python-ldaplibrary 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.With Python being a dynamically typed language, and the commonly used
JSONformat supportinglistanddict, it is to be expected that Python applications may commonly forward unchecked and potentially maliciouslistanddictobjects to the vulnerable sanitization method.The vulnerable
escape_mode=1configuration does not appear to be widely used.Suggested Fix
Add a type check at the start of the
ldap.filter.escape_filter_charsmethod to raise an exception when the suppliedassertion_valueparameter is not of typestr.CVE-2025-61912
Summary
ldap.dn.escape_dn_chars()escapes\x00incorrectly by emitting a backslash followed by a literal NUL byte instead of the RFC-4514 hex form\00. Any application that uses this helper to construct DNs from untrusted input can be made to consistently fail before a request is sent to the LDAP server (e.g., AD), resulting in a client-side denial of service.Details
Affected function:
ldap.dn.escape_dn_chars(s)File: Lib/ldap/dn.py
Buggy behavior:
For NUL, the function does:
s = s.replace('\000', '\\\000') # backslash + literal NULThis produces Python strings which, when passed to python-ldap APIs (e.g.,
add_s,modify_s, rename_s, or used as search bases), contain an embedded NUL. python-ldap then raises ValueError: embedded null character (or otherwise fails) before any network I/O.With correct RFC-4514 encoding (
\00), the client proceeds and the server can apply its own syntax rules (e.g., AD will reject NUL in CN with result: 34), proving the failure originates in the escaping helper.Why it matters: Projects follow the docs which state this function “should be used when building LDAP DN strings from arbitrary input.” The function’s guarantee is therefore relied upon as a safety API. A single NUL in attacker-controlled input reliably breaks client workflows (crash/unhandled exception, stuck retries, poison queue record), i.e., a DoS.
Standards: RFC 4514 requires special characters and controls to be escaped using hex form; a literal NUL is not a valid DN character.
Minimal fix: Escape NUL as hex:
s = s.replace('\x00', r'\00')PoC
Prereqs: Any python-ldap install and a reachable LDAP server (for the second half). The first half (client-side failure) does not require a live server.
Observed result (example):
add_s(buggy): ValueError embedded null character← client-side DoSadd_s(safe): INVALID_DN_SYNTAX (result 34, BAD_NAME)← request reached server; rejection due to server policy, not client bugImpact
Type: Denial of Service (client-side).
Who is impacted: Any application that uses ldap.dn.escape_dn_chars() to build DNs from (partially) untrusted input—e.g., user
creation/rename tools,sync/ETL jobs, portals allowing self-service attributes, device onboarding, batch imports. A single crafted value with\x00reliably forces exceptions/failures and can crash handlers or jam pipelines with poison records.Release Notes
python-ldap/python-ldap (python-ldap)
v3.4.5: 3.4.5Compare Source
Released 3.4.5 2025-10-10
Security fixes:
strinput inldap.filter.escape_filter_charswithescape_mode=1; ensure properescaping. (thanks to lukas-eu)
ldap.dn.escape_dn_charsto\00per RFC 4514. (thanks to aradona91)Fixes:
and TIMEOUT exceptions (previously only SERVER_DOWN), fixing reconnection
issues especially during server restarts
for result types
Tests:
handling and server restart scenarios
Doc/
Infrastructure:
Configuration
📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Renovate Bot.