Skip to content

Commit 8b4e0fb

Browse files
committed
fix(windows): accept the OWNER RIGHTS (S-1-3-4) ACE in DACL validation
The guards cache-dir rejection, once its SID was printed, was the OWNER RIGHTS well-known SID S-1-3-4: an ACE that modulates the rights granted to whoever OWNS the object. Both the daemon (win_bounded_sid_trusted) and the launcher (launcher_bounded_ace_sid_ is_trusted) validate the owner separately as the exact current user, so an OWNER RIGHTS ACE can only ever grant to us - it is safe. Default Windows profile/temp ACLs (and GitHub runner profiles) carry it, and rejecting it locked the daemon and launcher out of legitimate current-user directories (three green guards went red: non-ascii path, non-ascii cache dump, windows launcher). Accept WinCreatorOwnerRightsSid in both bounded-ACE checks. Real-user Windows fix, not just CI. mingw-cross-compiled clean. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
1 parent 897aa7a commit 8b4e0fb

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

‎src/daemon/ipc.c‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3875,7 +3875,13 @@ static bool win_bounded_sid_trusted(win_security_t *security, const uint8_t *sid
38753875
security->get_length_sid((PSID)sid) == (DWORD)sid_length &&
38763876
(win_sid_trusted(security, (PSID)sid) ||
38773877
(creator_owner_inherit_only &&
3878-
security->is_well_known_sid((PSID)sid, WinCreatorOwnerSid)));
3878+
security->is_well_known_sid((PSID)sid, WinCreatorOwnerSid)) ||
3879+
/* OWNER RIGHTS (S-1-3-4) modulates the rights of whoever OWNS the
3880+
* object; the owner is separately validated as the exact current
3881+
* user, so such an ACE only ever grants to us. Default Windows
3882+
* profile/temp ACLs (and GitHub runner profiles) carry it, and
3883+
* rejecting it locked real current-user directories out. */
3884+
security->is_well_known_sid((PSID)sid, WinCreatorOwnerRightsSid));
38793885
}
38803886

38813887
static bool win_file_owner_secure(win_security_t *security, HANDLE file,

‎src/launcher/windows_launcher.c‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,11 @@ static bool launcher_bounded_ace_sid_is_trusted(const ACE_HEADER *header, PSID c
228228
GetLengthSid((PSID)sid) == (DWORD)sid_length &&
229229
(launcher_sid_is_trusted((PSID)sid, current_user) ||
230230
(((header->AceFlags & INHERIT_ONLY_ACE) != 0U) &&
231-
IsWellKnownSid((PSID)sid, WinCreatorOwnerSid)));
231+
IsWellKnownSid((PSID)sid, WinCreatorOwnerSid)) ||
232+
/* OWNER RIGHTS (S-1-3-4) applies to the validated current-user
233+
* owner; default profile ACLs carry it, and rejecting it locked
234+
* the launcher out of legitimate current-user directories. */
235+
IsWellKnownSid((PSID)sid, WinCreatorOwnerRightsSid));
232236
}
233237

234238
static bool launcher_security_is_safe(HANDLE file, bool require_current_owner, DWORD mutation) {

0 commit comments

Comments
 (0)