Skip to content

Commit f420e1a

Browse files
committed
diag(daemon): name the untrusted SID class in a DACL rejection
The cache-private diagnostic pinned the guards failure to a private-dir DACL carrying a mutation ACE for an untrusted identity, but not WHICH - needed to tell a harness/profile ACL leak (an inherited Users / Authenticated Users / Everyone group ACE on the CI runner's admin profile) from a genuinely hostile grant. Classify the offending ACE's SID (BUILTIN\Users / Authenticated Users / Everyone / INTERACTIVE / other) in the message. Windows-only; mingw-verified. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
1 parent 4cb05fa commit f420e1a

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

‎src/daemon/ipc.c‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3974,9 +3974,19 @@ static bool win_file_acl_secure(win_security_t *security, HANDLE file, DWORD mut
39743974
size_t sid_capacity = (size_t)header->AceSize - sid_offset;
39753975
bool creator_owner_inherit_only = (header->AceFlags & INHERIT_ONLY_ACE) != 0U;
39763976
if (!win_bounded_sid_trusted(security, sid, sid_capacity, creator_owner_inherit_only)) {
3977+
/* Name the untrusted identity class so a harness/profile ACL leak
3978+
* (an inherited Users / Authenticated Users / Everyone ACE) is
3979+
* distinguishable from a genuinely hostile grant. */
3980+
const char *sid_class =
3981+
security->is_well_known_sid((PSID)sid, WinBuiltinUsersSid) ? "BUILTIN\\Users"
3982+
: security->is_well_known_sid((PSID)sid, WinAuthenticatedUserSid)
3983+
? "Authenticated Users"
3984+
: security->is_well_known_sid((PSID)sid, WinWorldSid) ? "Everyone"
3985+
: security->is_well_known_sid((PSID)sid, WinInteractiveSid) ? "INTERACTIVE"
3986+
: "other";
39773987
ipc_validation_detail_set(
3978-
"DACL entry %lu grants mutation rights 0x%08lx to an untrusted identity",
3979-
(unsigned long)index, (unsigned long)(ace->Mask & mutation));
3988+
"DACL entry %lu grants mutation rights 0x%08lx to untrusted identity (%s)",
3989+
(unsigned long)index, (unsigned long)(ace->Mask & mutation), sid_class);
39803990
secure = false;
39813991
}
39823992
}

0 commit comments

Comments
 (0)