Exploiting GOG Galaxy XPC service for privilege escalation in macOS

Being part of the Adversary Services team at IBM, it is important to keep your skills up to date and learn new things constantly.
MacOS security was one field where I decided to put more effort this year to further improve my exploitation and operation skills in macOS environments.
When GOG Galaxy is installed, it creates a new file in the /Library/LaunchDaemons directory with the name of com.
Usually, these processes are used as helper tools to perform privileged actions by a low privileged application.
Inspecting the PLIST file created by GOG Galaxy, it shows that an XPC service named com.
ClientService is exposed by the Privileged Helper tool located in /Library/PrivilegedHelperTools/com.
In macOS, PIDs can be reused and we can even replace current executables with a different process with posix spawn() while keeping the old PID. This was originally published on Warcon 18 in the presentation, Don't Trust the PID. This attack is based on a race condition where an exploit is going to send several messages to the XPC service and just after that, execute posix spawn with the binary that fulfills all the security requirements to replace the malicious binary PID. By queuing a lot of messages, the time between the message processing and process validation will allow the exploit to replace the exploit PID with the real application validating the connection.
Although we can manipulate the Privileged Helper and invoke any exposed methods, it is not useful unless these methods offer an opportunity for exploitation.
The protocol used between the XPC service and client was called ClientServiceProtocol.
As a low-privileged user, we can communicate with the XPC service and change the permissions of any file in the system.
D/login file is a configuration file for the Pluggable Authentication Modules system on macOS. It contains the default authentication configuration for all services that use PAM. Modifying the auth entries to use the pam permit.
Connect to the XPC through forked processes and replace the child processes with the legitimate binary.
Call the changeFolderPermissionsAtPath method that is exposed by the XPC modifying permissions of the /etc/pam.
Adversaries abuse XPC services to execute malicious code, perform application white-listing bypass, and escalate privileges.
On macOS, applications can leverage XPC services to send messages to the XPC service daemon, which runs with root privileges on the system.
These attacks often take advantage of improper XPC client validation and poor input validation to allow code to be executed with elevated privileges.
Securing XPC can be challenging as it requires secure coding practices from the application vendor such as enabling the hardened runtime for XPC services and notarizing the application.
Organizations can and should look for unsigned XPC client services and understand the risks associated with their operation in the environment.
Monitoring for processes that make suspicious calls to processes with elevated privileges could be an early indication of this type of attack.
To learn how IBM X-Force can help you with anything regarding cybersecurity including incident response, threat intelligence, or offensive security services schedule a meeting here.


This Cyber News was published on securityintelligence.com. Publication date: Thu, 07 Dec 2023 20:43:06 +0000


Cyber News related to Exploiting GOG Galaxy XPC service for privilege escalation in macOS

Exploiting GOG Galaxy XPC service for privilege escalation in macOS - Being part of the Adversary Services team at IBM, it is important to keep your skills up to date and learn new things constantly. MacOS security was one field where I decided to put more effort this year to further improve my exploitation and ...
1 year ago Securityintelligence.com
Researchers Exploited GOG Galaxy XPC Service in macOS - A critical privilege escalation vulnerability has been discovered to affect macOS devices, particularly the GOG Galaxy software-installed machines. The CVE for this vulnerability has been assigned as CVE-2023-40713, and the severity rating has been ...
1 year ago Cybersecuritynews.com CVE-2023-40713
CVE-2019-15511 - An exploitable local privilege escalation vulnerability exists in the GalaxyClientService installed by GOG Galaxy. Due to Improper Access Control, an attacker can send unauthenticated local TCP packets to the service to gain SYSTEM privileges in ...
4 years ago
CVE-2018-9105 - NordVPN 3.3.10 for macOS suffers from a root privilege escalation vulnerability. The vulnerability stems from its privileged helper tool's implemented XPC service. This XPC service is responsible for receiving and processing new OpenVPN ...
5 years ago
CVE-2018-8076 - ZenMate 1.5.4 for macOS suffers from a type confusion vulnerability within the com.zenmate.chron-xpc LaunchDaemon component. The LaunchDaemon implements an XPC service that uses an insecure XPC API for accessing data from an inbound XPC message. This ...
5 years ago
CVE-2018-7715 - PrivateVPN 2.0.31 for macOS suffers from a root privilege escalation vulnerability with its com.privat.vpn.helper privileged helper tool. This privileged helper tool implements an XPC service that allows arbitrary installed applications to connect ...
5 years ago
CVE-2018-7716 - PrivateVPN 2.0.31 for macOS suffers from a root privilege escalation vulnerability with its com.privat.vpn.helper privileged helper tool. This privileged helper tool implements an XPC service that allows arbitrary installed applications to connect ...
5 years ago
Protecting Your Device from Unwanted App Installations: An Overview of Samsung Galaxy Store Flaws - As more and more devices become connected to the internet, it's important to be aware of the security measures we should take to protect our data and digital identities. Smartphones and other mobile devices can be particularly vulnerable targets, due ...
2 years ago Securityweek.com
CVE-2018-10192 - IPVanish 3.0.11 for macOS suffers from a root privilege escalation vulnerability. The `com.ipvanish.osx.vpnhelper` LaunchDaemon implements an insecure XPC service that could allow an attacker to execute arbitrary code as the root user. IPVanish uses ...
6 years ago
SharePoint 0-day Vulnerability Exploited in Wild by All Sorts of Hacker Groups - File Indicators of Compromise (IoCs) SHA-1FilenameDetectionDescriptionF5B60A8EAD96703080E73A1F79C3E70FF44DF271spinstall0.aspxMSIL/Webshell.JSWebshell deployed via SharePoint vulnerabilities Network Indicators of Compromise (IoCs) IP ...
2 months ago Cybersecuritynews.com
CVE-2023-38297 - An issue was discovered in a third-party com.factory.mmigroup component, shipped on devices from multiple device manufacturers. Certain software builds for various Android devices contain a vulnerable pre-installed app with a package name of ...
1 year ago
Samsung Galaxy S23 hacked two more times at Pwn2Own Toronto - Security researchers hacked the Samsung Galaxy S23 smartphone two more times on the second day of the Pwn2Own 2023 hacking competition in Toronto, Canada. The contestants also demoed zero-day bugs in printers, routers, smart speakers, surveillance ...
1 year ago Bleepingcomputer.com
Samsung Galaxy S23 hacked twice on first day of Pwn2Own Toronto - Security researchers hacked the Samsung Galaxy S23 twice during the first day of the consumer-focused Pwn2Own 2023 hacking contest in Toronto, Canada. They also demoed exploits and vulnerability chains targeting zero-days in Xiaomi's 13 Pro ...
1 year ago Bleepingcomputer.com
What Is a Privilege Escalation Attack? Types & Prevention - Privilege escalation is a method that threat actors use to increase their access to systems and data that they aren't authorized to see. This guide to privilege escalation attacks covers the two main types, the avenues attackers use, and detection ...
1 year ago Esecurityplanet.com LAPSUS$ Turla Whitefly
Samsung Galaxy App Store Vulnerabilities: Exploits Released and What These Mean For Users - Exploits have recently been released for two Samsung Galaxy App Store vulnerabilities, representing a major security risk for users of the smartphone. The first vulnerability is in the Galaxy App Store where malicious app developers can bypass ...
2 years ago Bleepingcomputer.com
Security Flaws Found in Samsung's Galaxy Store for Android - Recent developments in the tech industry have jolted the world – smartphones, more so. In addition to boosting user convenience, these mini-computers have also made life easier for predators looking to exploit security loopholes. Therefore, it is ...
2 years ago Heimdalsecurity.com
CVE-2022-23470 - Galaxy is an open-source platform for data analysis. An arbitrary file read exists in Galaxy 22.01 and Galaxy 22.05 due to the switch to Gunicorn, which can be used to read any file accessible to the operating system user under which Galaxy is ...
2 years ago
CVE-2023-27578 - Galaxy is an open-source platform for data analysis. All supported versions of Galaxy are affected prior to 22.01, 22.05, and 23.0 are affected by an insufficient permission check. Unsupported versions are likely affected as far back as the ...
2 years ago
Speed­i­fy VPN ma­cOS Vulnerability Let Attackers Escalate Privilege - This oversight enabled a command injection vulnerability, allowing any local attacker to craft a malicious XPC message and inject arbitrary shell commands that would be executed as root. The flaw, uncovered by SecureLayer7, resides in the privileged ...
5 months ago Cybersecuritynews.com
Hackers earn over $1 million for 58 zero-days at Pwn2Own Toronto - The Pwn2Own Toronto 2023 hacking competition has ended with security researchers earning $1,038,500 for 58 zero-day exploits targeting consumer products between October 24 and October 27. During the Pwn2Own Toronto 2023 hacking event organized by ...
1 year ago Bleepingcomputer.com
CVE-2022-31262 - An exploitable local privilege escalation vulnerability exists in GOG Galaxy 2.0.46. Due to insufficient folder permissions, an attacker can hijack the %ProgramData%\GOG.com folder structure and change the GalaxyCommunication service executable to a ...
2 years ago
CVE-2016-4032 - Samsung SM-G920F build G920FXXU2COH2 (Galaxy S6), SM-N9005 build N9005XXUGBOK6 (Galaxy Note 3), GT-I9192 build I9192XXUBNB1 (Galaxy S4 mini), GT-I9195 build I9195XXUCOL1 (Galaxy S4 mini LTE), and GT-I9505 build I9505XXUHOJ2 (Galaxy S4) devices do not ...
8 years ago
CVE-2016-4030 - Samsung SM-G920F build G920FXXU2COH2 (Galaxy S6), SM-N9005 build N9005XXUGBOK6 (Galaxy Note 3), GT-I9192 build I9192XXUBNB1 (Galaxy S4 mini), GT-I9195 build I9195XXUCOL1 (Galaxy S4 mini LTE), and GT-I9505 build I9505XXUHOJ2 (Galaxy S4) devices have ...
8 years ago
CVE-2016-4031 - Samsung SM-G920F build G920FXXU2COH2 (Galaxy S6), SM-N9005 build N9005XXUGBOK6 (Galaxy Note 3), GT-I9192 build I9192XXUBNB1 (Galaxy S4 mini), GT-I9195 build I9195XXUCOL1 (Galaxy S4 mini LTE), and GT-I9505 build I9505XXUHOJ2 (Galaxy S4) devices allow ...
8 years ago
Samsung Galaxy Store App Found Vulnerable to Hackers - Security researchers have found that the Samsung Galaxy Store app is vulnerable to hackers, putting millions of users at risk of data theft and cyber attacks. According to researchers from the Security Research Center at Michigan University, the app ...
2 years ago Thehackernews.com

Cyber Trends (last 7 days)