Bug 2587449

Summary: CVE-2026-125628 samba: samba: extended response type confusion in ldapsrv_do_call crashes the AD DC LDAP worker [fedora-44]
Product: [Fedora] Fedora Reporter: TEJ RATHI <trathi>
Component: sambaAssignee: Guenther Deschner <gdeschner>
Status: NEW --- QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: high    
Version: 44CC: abokovoy, anoopcs, asn, gdeschner, pfilipen, sbose, ssorce
Target Milestone: ---Keywords: Security, SecurityTracking
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: {"flaws": ["0b3d13e1-bc5b-4c62-886b-26da74ba290a"]}
Fixed In Version: Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2587434    

Description TEJ RATHI 2026-11-30 16:02:30 UTC
Disclaimer: Community trackers are created by Red Hat Product Security team on a best effort basis. Package maintainers are required to ascertain if the flaw indeed affects their package, before starting the update process.

ldapsrv_do_call() in source4/ldap_server/ldap_backend.c uses the wrong message tag in the check that decides whether to log a connection that has not bound. When authz_logged is false, the arm labeled LDAP_TAG_ExtendedResponse reads call->request->r.ExtendedRequest and calls strcmp() on oid.

ldap_decode() in libcli/ldap/ldap_message.c stores an extended response in r.ExtendedResponse. ldap_decode_response() writes the result code into the ldap_Result at the start of that arm. The oid field of ldap_ExtendedRequest occupies those same leading bytes. ldapsrv_call_read_done() decodes the packet and queues the call. ldapsrv_process_call_trigger() calls ldapsrv_do_call() with no bind check. The connection is allocated with talloc_zero(), so authz_logged is false for the first message. A later switch in ldapsrv_do_call() calls ldapsrv_ExtendedRequest() for LDAP_TAG_ExtendedRequest and calls ldapsrv_unwilling() for a tag it does not list. The logging check runs before that switch. The wrong tag is present in samba 4.7.0rc1, in samba 4.25.1, and on the current master branch.

strcmp() dereferences the value in those leading bytes. Those bytes hold the result code and the alignment padding after it. They are not an OID string. The dereference faults the ldap worker. fault_setup() installs sig_fault() for SIGSEGV, sig_fault() calls fault_report(), and fault_report() calls smb_panic(), which aborts the worker. In the default prefork model the ldap service has its own master and workers, and each worker serves more than one client connection. Those connections end when the process exits. The prefork master starts a replacement worker. The first restart delay is 0. Each later exit of that worker adds the prefork backoff increment to the delay, up to the prefork maximum backoff. Those defaults are 10 seconds and 120 seconds. The default number of prefork children is 4. A caller who repeats the extended response can exit the ldap workers and leave them stopped for that delay. The rpc and kdc services are separate prefork services.

The caller is not authenticated. The logging check runs while authz_logged is false, which is the state of a new connection. The message is an LDAP extended response, and it is the first message on the connection.

The flaw is reachable in the default configuration of an AD DC. The service_ldap module is built when the AD DC build is enabled. ldapsrv_task_init() starts the LDAP server only when the server role is an Active Directory domain controller, and that server listens on port 389. The default server services list includes ldap, and the samba process model defaults to prefork.

Introduced in samba 4.7.0rc1 by commit f4a4522d1f8c19fdf142e12760160b15de1557ec (Andrew Bartlett, 3 March 2017), when logging of LDAP access before a bind was added. The wrong tag has been in that logging check since that commit. It is present in samba 4.7.0rc1, in samba 4.7.0, in samba 4.25.1, and on the current master branch. samba 4.6.16 does not contain the commit.