Tridge writes: A delegated GPO host-access tooling caller can inject LDAP filter syntax into cn, steer the first user/group result, and cause the tool to write an unintended allow/deny entry into SYSVOL policy XML. - python/samba/netcmd/gpo.py:4153-4168 defines cn as a positional argument. - python/samba/netcmd/gpo.py:4234-4239 searches expression="(cn=%s)" % cn. - python/samba/netcmd/gpo.py:4243-4252 uses res[0] objectClass and samaccountname. - python/samba/netcmd/gpo.py:4264-4270 writes manifest.xml and increments GPT.INI. Remaining uncertainty: No LDAP/SYSVOL runtime proof was run. Impact is bounded by GPO/SYSVOL write privileges; a fully privileged administrator can intentionally edit policy data. #### Dataflow Attacker role: samba-tool gpo manage access add caller, delegated GPO operator, or automation input source controlling the cn argument while the command has GPO/SYSVOL write rights. Entrypoint: cmd_add_access.run() accepts positional gpo, allow/deny, cn, and domain arguments. Trust boundary: Management CLI or wrapper input crosses into an LDAP search result that is serialized into SYSVOL policy XML. Controls and counterevidence: - etype is restricted to allow or deny. - The selected result is checked after search to be a user or group. - SYSVOL and GPO ACLs gate the savefile() and GPT.INI update. - The cn filter value is not escaped before constructing (cn=%s). Exploit steps: 1. Supply LDAP filter syntax in the cn argument to the host-access add command. 2. The command searches the selected domain with expression="(cn=%s)" % cn. 3. The first result is accepted if its final objectClass is user or group. Attacker outcome: A delegated GPO host-access tooling caller can inject LDAP filter syntax into cn, steer the first user/group result, and cause the tool to write an unintended allow/deny entry into SYSVOL policy XML. #### Severity Counterevidence: The final write is bounded by GPO/SYSVOL permissions, and an unrestricted administrator can directly edit policy contents; objectClass is checked after search. #### Remediation Escape cn with ldb.binary_encode(), include objectClass constraints in the safe filter, and require exact-result selection before writing the manifest. 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 | low | | Confidence | medium |
Created attachment 19110 [details] Patch for master I don't think this qualifies as a security bug, since you can't do anything that isn't allowed to -U$USERNAME.
Moving to just embargoed non-security
[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.