Tridge writes: A domain account or group name returned by winbind_lookup_sid() can be interpolated raw into RFC2307 uid/cn LDAP filters, allowing malformed, broadened, or expensive LDAP searches before exact-name result matching mitigates wrong-ID mapping. - source3/winbindd/idmap_rfc2307.c:464-508 stores uppercased names returned by winbind_lookup_sid(). - source3/winbindd/idmap_rfc2307.c:667-675 appends map->name directly into uid/cn filter clauses. - source3/winbindd/idmap_rfc2307.c:703-728 sends the built filters to ctx->search(). - source3/winbindd/idmap_rfc2307.c:568-599 maps only returned LDAP names that exactly match a pending map entry. - source3/passdb/pdb_ldap.c:321-345 escapes LDAP user material in a neighboring passdb path. Remaining uncertainty: No live AD/name-policy proof was run to confirm which LDAP metacharacters Samba can receive from winbind_lookup_sid() in all domain modes. #### Dataflow **Attacker role:** Domain principal or delegated operator able to create or influence user/group names that winbind resolves for SID-to-ID mapping. **Entrypoint:** idmap_rfc2307 receives SIDs to map and calls winbind_lookup_sid() for domain/name resolution. **Trust boundary:** Directory/account names from the domain cross into LDAP filter strings sent to the configured RFC2307 LDAP backend. **Controls and counterevidence:** - The RFC2307 idmap backend must be configured. - Returned LDAP records are uppercased and must exactly match a pending map entry before an ID is accepted. - Exploitability depends on whether the domain permits names with LDAP filter metacharacters through winbind_lookup_sid(). **Exploit steps:** - Create or control a domain user/group name containing LDAP filter syntax, if permitted by the domain. - Trigger SID-to-ID mapping for that SID on a server using idmap_rfc2307. - winbind_lookup_sid() returns the crafted name, which idmap_rfc2307 uppercases and places into an LDAP filter unescaped. - The LDAP server parses the altered filter, causing errors, broadened searches, expensive searches, or mapping confusion where exact-name matching can still be satisfied. #### Reachability The path is reachable under the attacker role and entry point documented above, with these limits considered: - The RFC2307 idmap backend must be configured. - Returned LDAP records are uppercased and must exactly match a pending map entry before an ID is accepted. - Exploitability depends on whether the domain permits names with LDAP filter metacharacters through winbind_lookup_sid(). Attacker outcome: A domain account or group name returned by winbind_lookup_sid() can be interpolated raw into RFC2307 uid/cn LDAP filters, allowing malformed, broadened, or expensive LDAP searches before exact-name result matching mitigates wrong-ID mapping. #### Severity **Impact calibration:** idmap lookup availability degradation and possible SID-to-UID/GID correctness issues in deployments with permissive account naming and RFC2307 LDAP mapping. **Likelihood calibration:** Medium: configuration and account-name-policy dependent, with exact-name post-filtering reducing but not removing injection effects. **Severity rationale:** Final severity is **medium** because the repository evidence shows a real trust-boundary crossing and reachable sink, while the listed controls and deployment preconditions bound exploitability and blast radius. Counterevidence and deployment limits considered: The RFC2307 idmap backend must be configured.; Returned LDAP records are uppercased and must exactly match a pending map entry before an ID is accepted.; Exploitability depends on whether the domain permits names with LDAP filter metacharacters through winbind_lookup_sid().. #### Remediation LDAP-escape map->name before filter construction, or use parameterized/search-builder APIs; keep exact-name result matching as a secondary defense. Add regression coverage that exercises the attacker-controlled input at the listed entry point and asserts the validation, authorization, containment, or size check occurs before the dangerous sink. | Severity | medium | | Confidence | medium |
Created attachment 19101 [details] patch for master
The report only suggests, and code inspection seems to back it up, that the attacker can cause resource use, not a wrong answer. Highest score I can justify is AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:L 4.3 and only then if the attacker can create arbitrarily named users (but is otherwise unprivileged, eg help desk), and such persons can just run out the RID pool etc. I don't think this is an embargo worthy security issue, just patch in master and move on.
I also don't think this is embargo-worthy. If I understand this correctly, all this could do is put load on (DoS?) a domain controller where the attacker can already create/rename objects. Under those circumstances, I think the attacker has easier ways to kill a DC. Yes, they can hide their traces better if they use winbind as a reflector, but is that really worth the CVE process? I think no.
[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.