In a newly provisioned Samba AD DC, a domain user added to the built-in Account Operators group, but not to Domain Admins, successfully reset the password of the distinct built-in Administrator account identified by domain SID RID 500. A separate ordinary domain-user control attempting the same reset was denied with LDAP error 50 (`LDAP_INSUFFICIENT_ACCESS_RIGHTS`). After the reset, a fresh bind as the RID-500 account succeeded; that account then added the original Account Operators user to Domain Admins, and a fresh authentication for that user contained the domain SID ending in `-512`. The attached validator records these gates as a boundary-breach witness. ## Tested versions - Samba `Version 4.24.5`, built from annotated tag object `6447c02e0b4feea6942133728783c49c7b4a3f22` and peeled commit `2ac52091905428fcaa48c10cc4e4fe439f9c679d`. - The archive uses `debian:12-slim@sha256:7b140f374b289a7c2befc338f42ebe6441b7ea838a042bbd5acbfca6ec875818` and Debian snapshot `20260729T000000Z`. ## Severity Tentative severity: High. ## CVSS v3.1 score Proposed CVSS v3.1 base score: `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H` = 8.8 (High). This is an initial assessment for an authenticated user whose delegated Account Operators membership is not Domain Admins membership and who can reach the AD DC LDAP service. ## Problem description The validator provisions a fresh loopback-only AD domain, creates `operator_attacker` and `ordinary_control`, and makes only `operator_attacker` a member of Account Operators. It resolves the separate target by the generated domain SID plus RID 500, then has both identities request a password reset through Samba LDAP. The ordinary control is rejected; the Account Operators request succeeds. A fresh LDAP bind with the changed RID-500 password succeeds, and that account adds `operator_attacker` to Domain Admins. A fresh LDAP connection for `operator_attacker` then reports the generated domain SID ending in `-512` in `tokenGroups`. The validator does not rely on an existing Administrator password, a shared attacker/victim identity, a cached token, or a pre-existing domain. It does not claim a CVE, a patch, or behavior in an untested configuration. ## Affected components The observed path is Samba AD DC provisioning of the built-in RID-500 Administrator account and the directory-service ACL handling of password-reset attributes and the force-password-change extended right. The evidence does not establish which provisioned ACL or authorization decision should be changed. ## Relevant source excerpts At Samba 4.24.5 commit `2ac52091905428fcaa48c10cc4e4fe439f9c679d`, [`source4/setup/provision_users.ldif:40-49`](https://gitlab.com/samba-team/samba/-/blob/2ac52091905428fcaa48c10cc4e4fe439f9c679d/source4/setup/provision_users.ldif#L40-49) defines the built-in Administrator account with `${DOMAINSID}-500`, `adminCount: 1`, and `isCriticalSystemObject: TRUE`. The reset authorization path treats `unicodePwd` as a password attribute and calls `acl_check_password_rights()` at [`source4/dsdb/samdb/ldb_modules/acl.c:2302-2327`](https://gitlab.com/samba-team/samba/-/blob/2ac52091905428fcaa48c10cc4e4fe439f9c679d/source4/dsdb/samdb/ldb_modules/acl.c#L2302-2327). For a force password set, [`acl.c:1851-1874`](https://gitlab.com/samba-team/samba/-/blob/2ac52091905428fcaa48c10cc4e4fe439f9c679d/source4/dsdb/samdb/ldb_modules/acl.c#L1851-1874) checks `GUID_DRS_FORCE_CHANGE_PASSWORD` against the requesting token: ```c c = ldb_request_get_control(req, DSDB_CONTROL_PASSWORD_HASH_VALUES_OID); if (c != NULL) { pav->pwd_reset = true; ret = acl_check_extended_right(tmp_ctx, module, req, objectclass, sd, acl_user_token(module), GUID_DRS_FORCE_CHANGE_PASSWORD, SEC_ADS_CONTROL_ACCESS, sid); goto checked; } ``` These excerpts identify the target definition and relevant authorization code; they are not a root-cause conclusion. ## Attacker prerequisites and configuration The demonstrated attacker is an authenticated domain user directly assigned to the built-in Account Operators group, but not to Domain Admins. The target is the separate built-in Administrator account with RID 500. The test uses a newly provisioned Samba AD DC and a loopback LDAP listener; it enables no VFS module, custom ACL, SMB service, or external directory integration. An affected deployment would need an Account Operators member able to reach its AD DC LDAP service. ## Potential fixes and decision options - Compare the default Samba AD DC authorization of `GUID_DRS_FORCE_CHANGE_PASSWORD` for Account Operators against the intended protection of the RID-500 and other protected accounts; change the provisioned descriptor or authorization path only after confirming the intended compatibility behavior. - Add a regression test that an Account Operators member cannot reset the RID-500 password, while an ordinary user remains denied and legitimate administrator password-management behavior remains covered. - If this behavior is intentional, document the boundary explicitly so operators do not treat Account Operators as unable to take control of the built-in Administrator account.
This looks like bug 12796. I'll leave that in peace for the moment.
To quote Andrew Bartlett elsewhere: > The most relevant note about this is the Windows behaviour, documented here: > > https://learn.microsoft.com/en-us/windows-server/identity/ad-ds/manage/understand-security-groups#account-operators > > (Account Operators cannot operate on the Administrator user or > administrators). >
I forgot to mention the report is from Artem Dinaburg and Ksawery Radziwilowicz.
(In reply to Douglas Bagnall from comment #1) I think we should just close this as a known duplicate of that public bug. An administrator who relies on this as a security control but doesn't check if the helpdesk staff are really restricted would be impacted, but we have never promoted or promised this feature in Samba specifically. We just get it due to ACLs we bring over by matching Windows. We can then focus on other bugs and let our user community propose a patch for this via the normal methods. I'm moving this to under the 'embargoed non-security' bugs for now.
[Bulk message on a number of bugs being made public at once] The embargo is being removed from this bug. That is not to say that the issue is not a real bug, but some things are better dealt with in public, where the normal process is both more available to external contributors and much, much more efficient. If you have a patch for this issue, please do contribute it via our normal GitLab process: https://wiki.samba.org/index.php/Contribute#Submitting_Patches_via_GitLab All patches to Samba must follow our copyright policy: https://www.samba.org/samba/devel/copyright-policy.html Thanks to all who report issues to Samba, we value your patience as we, along with the rest of the Open Source and Free Software communities, work though the reported issues.
*** This bug has been marked as a duplicate of bug 12796 ***