From f559f63063a64aba3f489aef210a9848a0850d48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?George=20Bi=C8=99oc?= Date: Sun, 13 Feb 2022 19:12:19 +0100 Subject: [PATCH] [SERVICES] Assign a World identity authority for Everyone SID, not Null authority The current code allocates memory and initializes the Everyone "World" security identifier but with a Null authority identifier. This is utterly wrong on so many levels, more so partly because a Null authority identifier is 0 so after the Everyone SID is initialized, it is actually initialized as S-1-0-0 instead of S-1-1-0. --- base/system/services/security.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/base/system/services/security.c b/base/system/services/security.c index b2639e95a20..2e8f284a714 100644 --- a/base/system/services/security.c +++ b/base/system/services/security.c @@ -55,6 +55,7 @@ DWORD ScmCreateSids(VOID) { SID_IDENTIFIER_AUTHORITY NullAuthority = {SECURITY_NULL_SID_AUTHORITY}; + SID_IDENTIFIER_AUTHORITY WorldAuthority = {SECURITY_WORLD_SID_AUTHORITY}; SID_IDENTIFIER_AUTHORITY NtAuthority = {SECURITY_NT_AUTHORITY}; PULONG pSubAuthority; ULONG ulLength1 = RtlLengthRequiredSid(1); @@ -78,7 +79,7 @@ ScmCreateSids(VOID) return ERROR_OUTOFMEMORY; } - RtlInitializeSid(pWorldSid, &NullAuthority, 1); + RtlInitializeSid(pWorldSid, &WorldAuthority, 1); pSubAuthority = RtlSubAuthoritySid(pWorldSid, 0); *pSubAuthority = SECURITY_WORLD_RID;