From 429e873981c0d51d509c6351605e9bb74d373064 Mon Sep 17 00:00:00 2001 From: rtrouton Date: Mon, 11 Sep 2023 14:25:44 -0400 Subject: [PATCH] Uploading Privileges 1.5.4 source code Uploading Privileges 1.5.4 source code, which includes security updates to address CVE-2023-40307. --- source/Constants.h | 50 +++++++++---------- source/MTAuthCommon.h | 2 +- source/MTAuthCommon.m | 2 +- source/MTIdentity.h | 2 +- source/MTIdentity.m | 2 +- source/Privileges.xcodeproj/project.pbxproj | 39 +++++++++------ source/Privileges/AppDelegate.h | 2 +- source/Privileges/AppDelegate.m | 18 +++---- source/Privileges/Base.lproj/MainMenu.xib | 4 +- source/Privileges/Info.plist | 4 +- source/Privileges/MTNotification.h | 2 +- source/Privileges/MTNotification.m | 2 +- source/Privileges/Privileges.mobileconfig | 12 +++++ source/Privileges/de.lproj/InfoPlist.strings | 4 +- .../Privileges/de.lproj/Localizable.strings | 6 +-- source/Privileges/en.lproj/InfoPlist.strings | 4 +- .../Privileges/en.lproj/Localizable.strings | 4 +- source/Privileges/es.lproj/InfoPlist.strings | 4 +- .../Privileges/es.lproj/Localizable.strings | 4 +- source/Privileges/fr.lproj/InfoPlist.strings | 4 +- .../Privileges/fr.lproj/Localizable.strings | 4 +- source/Privileges/it.lproj/InfoPlist.strings | 4 +- .../Privileges/it.lproj/Localizable.strings | 4 +- source/Privileges/main.m | 2 +- source/Privileges/nl.lproj/InfoPlist.strings | 4 +- .../Privileges/nl.lproj/Localizable.strings | 4 +- source/Privileges/pl.lproj/InfoPlist.strings | 4 +- .../Privileges/pl.lproj/Localizable.strings | 4 +- source/Privileges/ru.lproj/InfoPlist.strings | 4 +- .../Privileges/ru.lproj/Localizable.strings | 4 +- .../zh-Hans.lproj/InfoPlist.strings | 4 +- .../zh-Hans.lproj/Localizable.strings | 4 +- source/PrivilegesCLI/main.m | 24 +++++---- source/PrivilegesHelper/PrivilegesHelper.h | 2 +- source/PrivilegesHelper/PrivilegesHelper.m | 12 ++--- source/PrivilegesHelper/main.m | 2 +- source/PrivilegesTile/Info.plist | 2 +- source/PrivilegesTile/PrivilegesTile.h | 2 +- source/PrivilegesTile/PrivilegesTile.m | 2 +- source/PrivilegesXPC/PrivilegesXPC.m | 6 +-- 40 files changed, 146 insertions(+), 123 deletions(-) diff --git a/source/Constants.h b/source/Constants.h index 4ce5b81..c9598cd 100644 --- a/source/Constants.h +++ b/source/Constants.h @@ -1,6 +1,6 @@ /* Constants.h - Copyright 2022 SAP SE + Copyright 2023 SAP SE Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -15,28 +15,28 @@ limitations under the License. */ -#define kMTAdminGroupID 80 -#define kMTDockTimeoutDefault 20 -#define kMTReasonMinLengthDefault 10 -#define kMTReasonMaxLengthDefault 100 -#define kMTFixedTimeoutValues @[@0, @5, @10, @20, @60] +#define kMTAdminGroupID 80 +#define kMTDockTimeoutDefault 20 +#define kMTReasonMinLengthDefault 10 +#define kMTReasonMaxLengthDefault 100 +#define kMTFixedTimeoutValues @[@0, @5, @10, @20, @60] -#define kMTDefaultsToggleTimeout @"DockToggleTimeout" -#define kMTDefaultsToggleMaxTimeout @"DockToggleMaxTimeout" -#define kMTDefaultsEnforcePrivileges @"EnforcePrivileges" -#define kMTDefaultsAuthRequired @"RequireAuthentication" -#define kMTDefaultsLimitToUser @"LimitToUser" -#define kMTDefaultsLimitToGroup @"LimitToGroup" -#define kMTDefaultsRequireReason @"ReasonRequired" -#define kMTDefaultsReasonMinLength @"ReasonMinLength" -#define kMTDefaultsReasonMaxLength @"ReasonMaxLength" -#define kMTDefaultsReasonPresets @"ReasonPresetList" -#define kMTDefaultsRemoteLogging @"RemoteLogging" -#define kMTDefaultsRLServerType @"ServerType" -#define kMTDefaultsRLServerAddress @"ServerAddress" -#define kMTDefaultsRLServerPort @"ServerPort" -#define kMTDefaultsRLEnableTCP @"EnableTCP" -#define kMTDefaultsRLSyslogOptions @"SyslogOptions" -#define kMTDefaultsRLSyslogFacility @"LogFacility" -#define kMTDefaultsRLSyslogSeverity @"LogSeverity" -#define kMTDefaultsRLSyslogMaxSize @"MaximumMessageSize" +#define kMTDefaultsToggleTimeout @"DockToggleTimeout" +#define kMTDefaultsToggleMaxTimeout @"DockToggleMaxTimeout" +#define kMTDefaultsEnforcePrivileges @"EnforcePrivileges" +#define kMTDefaultsAuthRequired @"RequireAuthentication" +#define kMTDefaultsLimitToUser @"LimitToUser" +#define kMTDefaultsLimitToGroup @"LimitToGroup" +#define kMTDefaultsRequireReason @"ReasonRequired" +#define kMTDefaultsReasonMinLength @"ReasonMinLength" +#define kMTDefaultsReasonMaxLength @"ReasonMaxLength" +#define kMTDefaultsReasonPresets @"ReasonPresetList" +#define kMTDefaultsRemoteLogging @"RemoteLogging" +#define kMTDefaultsRLServerType @"ServerType" +#define kMTDefaultsRLServerAddress @"ServerAddress" +#define kMTDefaultsRLServerPort @"ServerPort" +#define kMTDefaultsRLEnableTCP @"EnableTCP" +#define kMTDefaultsRLSyslogOptions @"SyslogOptions" +#define kMTDefaultsRLSyslogFacility @"LogFacility" +#define kMTDefaultsRLSyslogSeverity @"LogSeverity" +#define kMTDefaultsRLSyslogMaxSize @"MaximumMessageSize" diff --git a/source/MTAuthCommon.h b/source/MTAuthCommon.h index 7cf224b..3439145 100644 --- a/source/MTAuthCommon.h +++ b/source/MTAuthCommon.h @@ -1,6 +1,6 @@ /* MTAuthCommon.h - Copyright 2016-2022 SAP SE + Copyright 2016-2023 SAP SE Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/source/MTAuthCommon.m b/source/MTAuthCommon.m index 175ce9d..dc9e54c 100644 --- a/source/MTAuthCommon.m +++ b/source/MTAuthCommon.m @@ -1,6 +1,6 @@ /* MTAuthCommon.m - Copyright 2016-2022 SAP SE + Copyright 2016-2023 SAP SE Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/source/MTIdentity.h b/source/MTIdentity.h index 13e0e48..07a30d4 100644 --- a/source/MTIdentity.h +++ b/source/MTIdentity.h @@ -1,6 +1,6 @@ /* MTIdentity.h - Copyright 2016-2022 SAP SE + Copyright 2016-2023 SAP SE Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/source/MTIdentity.m b/source/MTIdentity.m index c51d7f6..c8892a1 100644 --- a/source/MTIdentity.m +++ b/source/MTIdentity.m @@ -1,6 +1,6 @@ /* MTIdentity.m - Copyright 2016-2022 SAP SE + Copyright 2016-2023 SAP SE Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/source/Privileges.xcodeproj/project.pbxproj b/source/Privileges.xcodeproj/project.pbxproj index edd20a1..9ee7185 100644 --- a/source/Privileges.xcodeproj/project.pbxproj +++ b/source/Privileges.xcodeproj/project.pbxproj @@ -524,7 +524,8 @@ ADA960591C905F36002AEFEA /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1400; + BuildIndependentTargetsInParallel = YES; + LastUpgradeCheck = 1500; ORGANIZATIONNAME = "SAP SE"; TargetAttributes = { AD703CF22385361700A8D946 = { @@ -822,8 +823,8 @@ ENABLE_HARDENED_RUNTIME = YES; GCC_C_LANGUAGE_STANDARD = gnu11; INFOPLIST_FILE = PrivilegesXPC/Info.plist; - MACOSX_DEPLOYMENT_TARGET = 10.12; - MARKETING_VERSION = 1.5.3; + MACOSX_DEPLOYMENT_TARGET = 10.13; + MARKETING_VERSION = 1.5.4; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = corp.sap.privileges.xpc; @@ -849,8 +850,8 @@ ENABLE_HARDENED_RUNTIME = YES; GCC_C_LANGUAGE_STANDARD = gnu11; INFOPLIST_FILE = PrivilegesXPC/Info.plist; - MACOSX_DEPLOYMENT_TARGET = 10.12; - MARKETING_VERSION = 1.5.3; + MACOSX_DEPLOYMENT_TARGET = 10.13; + MARKETING_VERSION = 1.5.4; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = corp.sap.privileges.xpc; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -985,13 +986,14 @@ "$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks", ); INFOPLIST_FILE = Privileges/Info.plist; + INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities"; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@loader_path/../Frameworks", "@executable_path/../Frameworks", ); - MACOSX_DEPLOYMENT_TARGET = 10.12; - MARKETING_VERSION = 1.5.3; + MACOSX_DEPLOYMENT_TARGET = 10.13; + MARKETING_VERSION = 1.5.4; PRODUCT_BUNDLE_IDENTIFIER = corp.sap.privileges; PRODUCT_NAME = "$(TARGET_NAME)"; }; @@ -1016,13 +1018,14 @@ "$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks", ); INFOPLIST_FILE = Privileges/Info.plist; + INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities"; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@loader_path/../Frameworks", "@executable_path/../Frameworks", ); - MACOSX_DEPLOYMENT_TARGET = 10.12; - MARKETING_VERSION = 1.5.3; + MACOSX_DEPLOYMENT_TARGET = 10.13; + MARKETING_VERSION = 1.5.4; PRODUCT_BUNDLE_IDENTIFIER = corp.sap.privileges; PRODUCT_NAME = "$(TARGET_NAME)"; }; @@ -1038,7 +1041,8 @@ DEVELOPMENT_TEAM = 7R5ZEU67FQ; ENABLE_HARDENED_RUNTIME = YES; INFOPLIST_FILE = "PrivilegesHelper/PrivilegesHelper-Info.plist"; - MARKETING_VERSION = 1.5.3; + MACOSX_DEPLOYMENT_TARGET = 10.13; + MARKETING_VERSION = 1.5.4; OTHER_LDFLAGS = ( "-sectcreate", __TEXT, @@ -1061,7 +1065,8 @@ DEVELOPMENT_TEAM = 7R5ZEU67FQ; ENABLE_HARDENED_RUNTIME = YES; INFOPLIST_FILE = "PrivilegesHelper/PrivilegesHelper-Info.plist"; - MARKETING_VERSION = 1.5.3; + MACOSX_DEPLOYMENT_TARGET = 10.13; + MARKETING_VERSION = 1.5.4; OTHER_LDFLAGS = ( "-sectcreate", __TEXT, @@ -1085,7 +1090,8 @@ DEVELOPMENT_TEAM = 7R5ZEU67FQ; ENABLE_HARDENED_RUNTIME = YES; INFOPLIST_FILE = "$(SRCROOT)/PrivilegesCLI/PrivilegesCLI-Info.plist"; - MARKETING_VERSION = 1.5.3; + MACOSX_DEPLOYMENT_TARGET = 10.13; + MARKETING_VERSION = 1.5.4; OTHER_LDFLAGS = ""; PRODUCT_BUNDLE_IDENTIFIER = corp.sap.privileges.cli; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -1104,7 +1110,8 @@ DEVELOPMENT_TEAM = 7R5ZEU67FQ; ENABLE_HARDENED_RUNTIME = YES; INFOPLIST_FILE = "$(SRCROOT)/PrivilegesCLI/PrivilegesCLI-Info.plist"; - MARKETING_VERSION = 1.5.3; + MACOSX_DEPLOYMENT_TARGET = 10.13; + MARKETING_VERSION = 1.5.4; OTHER_LDFLAGS = ""; PRODUCT_BUNDLE_IDENTIFIER = corp.sap.privileges.cli; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -1149,7 +1156,8 @@ GCC_WARN_UNUSED_FUNCTION = YES; INFOPLIST_FILE = PrivilegesTile/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles"; - MARKETING_VERSION = 1.5.3; + MACOSX_DEPLOYMENT_TARGET = 10.13; + MARKETING_VERSION = 1.5.4; OTHER_LDFLAGS = ( "-framework", AppKit, @@ -1202,7 +1210,8 @@ GCC_WARN_UNUSED_FUNCTION = YES; INFOPLIST_FILE = PrivilegesTile/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles"; - MARKETING_VERSION = 1.5.3; + MACOSX_DEPLOYMENT_TARGET = 10.13; + MARKETING_VERSION = 1.5.4; OTHER_LDFLAGS = ( "-framework", AppKit, diff --git a/source/Privileges/AppDelegate.h b/source/Privileges/AppDelegate.h index 5a02c49..e9cd722 100644 --- a/source/Privileges/AppDelegate.h +++ b/source/Privileges/AppDelegate.h @@ -1,6 +1,6 @@ /* AppDelegate.h - Copyright 2016-2022 SAP SE + Copyright 2016-2023 SAP SE Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/source/Privileges/AppDelegate.m b/source/Privileges/AppDelegate.m index e053320..f0e331e 100644 --- a/source/Privileges/AppDelegate.m +++ b/source/Privileges/AppDelegate.m @@ -1,6 +1,6 @@ /* AppDelegate.m - Copyright 2016-2022 SAP SE + Copyright 2016-2023 SAP SE Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -190,13 +190,13 @@ - (void)changeAdminGroup:(NSString*)userName remove:(BOOL)remove [self connectAndExecuteCommandBlock:^(NSError *connectError) { if (connectError) { - os_log(OS_LOG_DEFAULT, "SAPCorp: ERROR! %{public}@", connectError); + os_log_with_type(OS_LOG_DEFAULT, OS_LOG_TYPE_ERROR, "SAPCorp: %{public}@", connectError); [self displayErrorNotificationAndExit]; } else { [[self.helperToolConnection remoteObjectProxyWithErrorHandler:^(NSError *proxyError) { - os_log(OS_LOG_DEFAULT, "SAPCorp: ERROR! %{public}@", proxyError); + os_log_with_type(OS_LOG_DEFAULT, OS_LOG_TYPE_ERROR, "SAPCorp: %{public}@", proxyError); [self displayErrorNotificationAndExit]; }] changeAdminRightsForUser:userName @@ -206,7 +206,7 @@ - (void)changeAdminGroup:(NSString*)userName remove:(BOOL)remove withReply:^(NSError *error) { if (error) { - os_log(OS_LOG_DEFAULT, "SAPCorp: ERROR! Unable to change privileges: %{public}@", error); + os_log_with_type(OS_LOG_DEFAULT, OS_LOG_TYPE_ERROR, "SAPCorp: Unable to change privileges: %{public}@", error); [self displayErrorNotificationAndExit]; } else { @@ -285,12 +285,12 @@ - (void)checkForHelper - (void)helperCheckFailed:(NSString*)errorMessage { - os_log(OS_LOG_DEFAULT, "SAPCorp: ERROR! %{public}@", errorMessage); + os_log_with_type(OS_LOG_DEFAULT, OS_LOG_TYPE_ERROR, "SAPCorp: %{public}@", errorMessage); [self connectToXPCService]; [[self.xpcServiceConnection remoteObjectProxyWithErrorHandler:^(NSError *proxyError) { - os_log(OS_LOG_DEFAULT, "SAPCorp: ERROR! %{public}@", proxyError); + os_log_with_type(OS_LOG_DEFAULT, OS_LOG_TYPE_ERROR, "SAPCorp: %{public}@", proxyError); [self displayDialog:NSLocalizedString(@"notificationText_Error", nil) messageText:nil @@ -309,7 +309,7 @@ - (void)helperCheckFailed:(NSString*)errorMessage } else { - os_log(OS_LOG_DEFAULT, "SAPCorp: ERROR! Installation of the helper tool failed: %{public}@", installError); + os_log_with_type(OS_LOG_DEFAULT, OS_LOG_TYPE_ERROR, "SAPCorp: Installation of the helper tool failed: %{public}@", installError); [self displayDialog:NSLocalizedString(@"notificationText_Error", nil) messageText:nil @@ -841,11 +841,11 @@ -(void)applicationWillTerminate:(NSNotification *)aNotification [self connectAndExecuteCommandBlock:^(NSError * connectError) { if (connectError) { - os_log(OS_LOG_DEFAULT, "SAPCorp: ERROR! %{public}@", connectError); + os_log_with_type(OS_LOG_DEFAULT, OS_LOG_TYPE_ERROR, "SAPCorp: %{public}@", connectError); } else { [[self.helperToolConnection remoteObjectProxyWithErrorHandler:^(NSError *proxyError) { - os_log(OS_LOG_DEFAULT, "SAPCorp: ERROR! %{public}@", proxyError); + os_log_with_type(OS_LOG_DEFAULT, OS_LOG_TYPE_ERROR, "SAPCorp: %{public}@", proxyError); }] quitHelperTool]; } } diff --git a/source/Privileges/Base.lproj/MainMenu.xib b/source/Privileges/Base.lproj/MainMenu.xib index 028c391..5d95c41 100644 --- a/source/Privileges/Base.lproj/MainMenu.xib +++ b/source/Privileges/Base.lproj/MainMenu.xib @@ -1,8 +1,8 @@ - + - + diff --git a/source/Privileges/Info.plist b/source/Privileges/Info.plist index c9dddfc..9ac4737 100644 --- a/source/Privileges/Info.plist +++ b/source/Privileges/Info.plist @@ -19,7 +19,7 @@ CFBundleSignature ???? CFBundleVersion - 1330 + 1375 LSApplicationCategoryType public.app-category.utilities LSMinimumSystemVersion @@ -27,7 +27,7 @@ NSDockTilePlugIn PrivilegesTile.docktileplugin NSHumanReadableCopyright - Copyright © 2016-2022 SAP SE. All rights reserved. + Copyright © 2016-2023 SAP SE. All rights reserved. NSMainNibFile MainMenu NSPrincipalClass diff --git a/source/Privileges/MTNotification.h b/source/Privileges/MTNotification.h index 210f4d4..742bb10 100644 --- a/source/Privileges/MTNotification.h +++ b/source/Privileges/MTNotification.h @@ -1,6 +1,6 @@ /* MTNotification.h - Copyright 2016-2022 SAP SE + Copyright 2016-2023 SAP SE Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/source/Privileges/MTNotification.m b/source/Privileges/MTNotification.m index fe958d9..2cf2a2d 100644 --- a/source/Privileges/MTNotification.m +++ b/source/Privileges/MTNotification.m @@ -1,6 +1,6 @@ /* MTNotification.m - Copyright 2016-2022 SAP SE + Copyright 2016-2023 SAP SE Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/source/Privileges/Privileges.mobileconfig b/source/Privileges/Privileges.mobileconfig index e107612..dcb8435 100644 --- a/source/Privileges/Privileges.mobileconfig +++ b/source/Privileges/Privileges.mobileconfig @@ -175,6 +175,18 @@ limitations under the License. + + PostChangeExecutablePath + /Library/Application Support/Privileges/PrivilegesChanged.sh +