Introduction
A single malformed LDAP message, sent before any authentication, is enough to crash a Samba Active Directory domain controller's LDAP worker and take the other clients on that worker down with it. For environments running Samba as an AD DC, CVE-2026-125628 turns one stray ExtendedResponse PDU into a sustained denial of service, with each repeat pushing the restart backoff longer.
Samba is a community developed and maintained implementation of the SMB and Active Directory protocols for Linux and UNIX systems, licensed under the GNU General Public License and belonging to the Software Freedom Conservancy. It can run as an Active Directory domain controller or as a member server, exposing services that build on LDAP and Kerberos. That role distinction matters here, because only the AD DC LDAP role is affected.
Technical Information
The vulnerability is a CWE-843 type confusion (Access of Resource Using Incompatible Type) in ldapsrv_do_call() in source4/ldap_server/ldap_backend.c.
Before a client successfully binds, Samba decides whether an incoming operation should be written to the authorization log. That decision is made with a switch on the message type. One arm was meant to skip logging for StartTLS, which is an LDAP ExtendedRequest with a specific OID. The case label, however, was written for the wrong tag. Here is the faulty code and its correction, from the upstream diff:
- case LDAP_TAG_ExtendedResponse: { + case LDAP_TAG_ExtendedRequest: { struct ldap_ExtendedRequest *req = &call->request->r.ExtendedRequest; if (strcmp(req->oid, LDB_EXTENDED_START_TLS_OID) == 0) { log = false;
The root cause is in how the decoded message is stored. The fields live in call->request->r, a union that holds exactly one operation at a time, and the valid interpretation depends on the message tag. When a client sends an ExtendedResponse PDU, ldap_decode() fills in r.ExtendedResponse. That structure begins with the integer resultcode followed by alignment padding, not an OID string pointer. The mislabeled case lets that response into the StartTLS block, which then reads the same bytes as r.ExtendedRequest.oid and passes them to strcmp() as a string pointer.
The resulting bad dereference faults the LDAP worker. Samba's handler follows the fault_setup()/sig_fault()/fault_report() path into smb_panic(), which aborts the worker. The trigger is an ExtendedResponse sent as the first message on a new connection, while authz_logged is still false, which is the default talloc_zero() state of a freshly accepted connection.
Why repetition sustains the outage
The availability impact is amplified by the default prefork process model, which runs four LDAP children. Each worker serves multiple client connections, so crashing one worker disconnects every legitimate client it was serving. The prefork master restarts a replacement, but each subsequent exit adds 10 seconds to the restart delay, up to a maximum of 120 seconds. Repeating the trigger against successive replacements keeps workers unavailable across those backoff windows.
Attack flow
- The attacker opens a plain TCP connection to an AD DC on port 389. No credentials are needed.
- Before any bind, the attacker sends a single LDAP PDU whose tag is
LDAP_TAG_ExtendedResponse. - The pre-bind logging check in
ldapsrv_do_call()interprets the response as an ExtendedRequest and callsstrcmp()on bytes that are not an OID pointer. - The worker segfaults and panics, dropping every client connection it was serving.
- The master starts a replacement. The attacker repeats the message, and each crash increases the restart backoff, keeping the LDAP service unavailable.
The published CVSS v3.1 vector is AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H: network reachable, low complexity, no privileges, no user interaction, availability only impact with no confidentiality or integrity effect.
Proof of Concept
The public, verifiable reproducer exists as an in-tree Samba smbtorture regression test rather than a standalone weaponized exploit. Merge request !4819 adds the test samba4.ldap.extended-response in a new file, source4/torture/ldap/extended_response.c, authored by Denis Rastyogin, who is also credited by Red Hat for reporting the issue. The merge request reports that the test fails (server crashes, no reply) without the fix and passes with it:
bool torture_ldap_extended_response(struct torture_context *tctx) { const char *host = torture_setting_string(tctx, "host", NULL); const char *url = talloc_asprintf(tctx, "ldap://%s/", host); struct ldap_connection *conn = NULL; struct ldap_message *msg = NULL; struct ldap_request *req = NULL; NTSTATUS status; status = torture_ldap_connection(tctx, &conn, url); torture_assert_ntstatus_ok(tctx, status, "connect failed"); /* Must be the first PDU on the connection, before any bind */ msg = new_ldap_message(conn); torture_assert(tctx, msg != NULL, "out of memory"); msg->type = LDAP_TAG_ExtendedResponse; req = ldap_request_send(conn, msg); torture_assert(tctx, req != NULL, "ldap_request_send failed"); status = ldap_result_one(req, &msg, LDAP_TAG_ExtendedResponse); torture_assert_ntstatus_ok(tctx, status, "no reply, server crashed?"); torture_assert_int_equal(tctx, msg->r.ExtendedResponse.response.resultcode, LDAP_PROTOCOL_ERROR, "unexpected result code"); torture_ldap_close(conn); return true; }
The core PoC primitive is trivial to reproduce manually: open a plain TCP/LDAP connection to an AD DC on port 389 and send, as the first message before any bind, an LDAP PDU whose tag is ExtendedResponse. On a vulnerable server this produces no protocol-error reply and instead crashes the LDAP worker. The test's "no reply, server crashed?" assertion is the crash oracle. Repeating the message drives the sustained denial of service. No standalone weaponized exploit script was found. The regression test and the Red Hat/Bugzilla write-up constitute the public PoC evidence.
Patch Information
The fix exists only as an unmerged merge request: Samba GitLab merge request !4819, "CVE-2026-125628: s4:ldap_server: fix ExtendedRequest tag in pre-bind check," from Denis Rastyogin, linked to Samba Bugzilla bug 16306.
The fix changes a single token. With the case label set to LDAP_TAG_ExtendedRequest, the code only reads r.ExtendedRequest.oid when the decoder actually filled in an ExtendedRequest, so the pointer is valid. A client sent ExtendedResponse, which is not valid server input, no longer enters the block, and the server now answers it with LDAP_PROTOCOL_ERROR instead of crashing. There is also a functional side effect: StartTLS is now correctly recognized and left out of pre-bind logging as originally intended, which never happened under the old label.
The merge request has two commits, a common Samba pattern:
- Commit
91a6c210adds the smbtorture testsamba4.ldap.extended-responseinsource4/torture/ldap/extended_response.c, registers it insource4/torture/ldap/common.candsource4/torture/wscript_build, and addsselftest/knownfail.d/ldap-extended-responseso the test is marked as expected to fail until the fix lands. - Commit
16f34abcchanges the case label and deletes the knownfail entry, proving the fix turns the test from failing to passing.
One developer (Matthias Wallnoefer) approved the change and called it a "good catch," and CI passed on head commit 16f34abc. GitLab still shows the merge as blocked: it needs remaining required approvals, and the branch is 290 commits behind master and must be rebased. No Samba release containing this change is confirmed, so for now the patch must be applied manually. Samba maintainers added the merge request to their "security tracking" label, but Samba states that this label alone does not mean the issue qualifies for a formal security release or advisory.
Detection Methods
No public Sigma, YARA, or Snort/Suricata rules or IoC feeds have been published for CVE-2026-125628. What is available comes from the upstream fix: an active check, a source-level check, and protocol and host behaviour to watch for.
Network behaviour
An ExtendedResponse is a message servers send to clients. A client has no legitimate reason to send one to a server, especially as the first message before any bind, which makes the trigger unusually easy to distinguish from normal traffic.
- If your network monitoring decodes LDAP on TCP/389 to your AD DCs, look for LDAP ExtendedResponse messages travelling from client to server, with the most attention on cases where that message is the first on a new connection.
- This is a behavioural idea, not a published rule. You would need to build and test the logic in your own IDS/NDR; no vendor signature has been verified.
Host-side signs of a worker crash
The Red Hat Bugzilla analysis describes what happens on the server after the trigger:
- The worker takes a SIGSEGV.
sig_fault()callsfault_report(), which callssmb_panic()and aborts the worker. Watch the AD DC's Samba logs for panic or fault reports from the LDAP service and for crash dumps or abnormal exits of LDAP worker processes. - Under the default prefork model each worker serves several clients, so one crash drops every connection on that worker. Legitimate clients see sudden LDAP disconnects at the same moment.
- The prefork master restarts the worker. The first restart is immediate, and each further exit adds a 10-second backoff, up to 120 seconds. By default there are 4 children. A pattern of repeated LDAP worker restarts with growing delays, while RPC and KDC services keep running, matches repeated exploitation well.
- Correlate these crash events with the network observation above. A new unauthenticated connection to port 389 just before each worker crash is a strong combined signal.
No exact log strings for this CVE have been published, so build alerts around worker-crash and restart events rather than a specific message.
Active check: the upstream smbtorture test
Merge request !4819 adds the regression test samba4.ldap.extended-response, which fails without the fix and passes with it:
make test TESTS='samba4.ldap.extended-response'
The test opens an LDAP connection and, before any bind, sends a single message of type LDAP_TAG_ExtendedResponse, then expects a reply:
status = ldap_result_one(req, &msg, LDAP_TAG_ExtendedResponse); torture_assert_ntstatus_ok(tctx, status, "no reply, server crashed?"); torture_assert_int_equal(tctx, msg->r.ExtendedResponse.response.resultcode, LDAP_PROTOCOL_ERROR, "unexpected result code");
A fixed server rejects the message and replies with LDAP_PROTOCOL_ERROR. A vulnerable server sends no reply because the worker crashed, and the test fails on the "no reply, server crashed?" assertion. Caution: this test sends the real crash trigger and will kill an LDAP worker and disconnect every client on it. Run it only against a lab or staging DC built from the same Samba version as production.
Source and build checks
If you build Samba yourself or can inspect a vendor's source package, open source4/ldap_server/ldap_backend.c and look at the pre-bind logging switch in ldapsrv_do_call(). If the branch that reads call->request->r.ExtendedRequest and compares req->oid against the StartTLS OID is labelled case LDAP_TAG_ExtendedResponse:, the code is vulnerable. If it is labelled case LDAP_TAG_ExtendedRequest:, it is fixed. Per Red Hat, the wrong tag arrived in 4.7.0rc1 (commit f4a4522d1f8c19fdf142e12760160b15de1557ec) and is still present in 4.25.1 and on master, so version based scanner results for 4.7.0rc1 and later should be confirmed with this source check or the active test, especially where distributions backport fixes.
Scope your monitoring
The vulnerable LDAP server only runs when Samba is an Active Directory domain controller: service_ldap must be built and the ldap service enabled, which is the default for an AD DC. File servers and member servers do not expose this code path, and Red Hat states that its RHEL Samba builds use --without-ad-dc. Start your inventory by finding Samba hosts in the AD DC role that listen on TCP/389 and focus both network and host monitoring there.
Affected Systems and Versions
- The flaw affects the LDAP server in Samba when running as an Active Directory domain controller. File servers and member servers do not expose the code path.
- Vulnerable upstream code was introduced in Samba 4.7.0rc1 by commit
f4a4522d1f8c19fdf142e12760160b15de1557ec(dated March 3, 2017) and is present through 4.7.0, 4.25.1, and master. - Samba 4.6.16 predates the introducing commit and is not affected.
- No fixed released version is identified in the reviewed records. The correction exists only as unmerged merge request !4819.
- Red Hat states that RHEL 6, 7, 8, 9 and 10, and Red Hat In-Vehicle Operating System 2 use Samba builds compiled without the AD DC LDAP server module, so the vulnerable code is absent. RHCOS does not ship Samba by default, and OpenShift images consume the unaffected RHEL builds. Red Hat marks these products as not affected.
Vendor Security History
The briefing references two prior Samba LDAP and VFS defects that illustrate how impact and prerequisites vary by component:
- CVE-2020-10704 was a different LDAP defect where a deeply nested filter in an unauthenticated search could exhaust stack memory and cause a SIGSEGV. Samba's advisory noted that crashing a shared worker disrupts legitimate clients, and it carried the same 7.5 CVSS vector used for the current issue. Samba issued 4.10.15, 4.11.8 and 4.12.2. Those releases do not fix CVE-2026-125628, and that advisory's process model workaround is not established for the current flaw.
- CVE-2021-44142 was an out of bounds heap read/write in
vfs_fruitthat could allow arbitrary code execution as root, requiring the affected module and access to write file extended attributes. Samba supplied fixes in 4.13.17, 4.14.12 and 4.15.5. This is materially different from the current unauthenticated LDAP worker crash, which illustrates why neither historic code execution severity nor an unrelated module workaround should be transferred to the present CVE.
Samba documents a coordinated disclosure process with CVSS scoring, patches, tests, and backports for supported releases, while noting that some minor issues appear only in Bugzilla rather than producing a security release. For this incident the decisive unresolved question is delivery of a fixed supported build, not whether Samba has a security process.
References
- NVD: CVE-2026-125628
- MITRE CVE record: CVE-2026-125628
- Red Hat Customer Portal: CVE-2026-125628
- Red Hat Bugzilla 2587434
- Samba Bugzilla 16306
- Samba GitLab Merge Request !4819
- Merge Request !4819 diff
- Merge Request !4819 patch
- Merge Request !4819 diffs view
- What is Samba?
- Samba Security Updates and Information
- Samba Security Process
- Samba Security Announcement: CVE-2021-44142
- Samba Security Announcement: CVE-2020-10704
- Samba Server Security
- Hardening Samba as an AD DC
- VulDB: CVE-2026-125628



