CVE-2023-33298 - Perimeter81 Local Privilege Escalation
The Perimeter81 macOS helper tool exposed an XPC service that accepted commands without proper validation, and one of its methods passed a user-supplied path into a shell command. An attacker with local access could send a crafted XPC message to execute arbitrary commands as root.
Today we will be analyzing CVE-2023-33298 which is Local Privilege Escalation inside the Perimeter81 macOS application. We will be exploiting XPC service misconfiguration along with the Command Injection vulnerability to gain root privileges.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the XPC service lacked client validation and passed the usingCAPath value directly into a shell command without sanitisation.
Impact
A local attacker could execute arbitrary commands with root privileges.
What the attacker needed
Local access to the macOS system
The fix
The vulnerability was fixed in version 10.1.2.318.
How it was found
- Connect to the com.perimeter81.osx.HelperTool XPC service.
- Create a parameters dictionary with the key usingCAPath set to a value starting with a semicolon followed by the desired command.
- Create a message dictionary with type set to helper_tool_rpc, rpc set to install_SDP_CA, and parameters set to the previous dictionary.
- Send the message to the XPC service.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
A helper tool runs with high privileges on macOS and listens for messages from other programs. Because it did not check who was sending messages and built a shell command from user input, any local user could ask it to run their own commands as the administrator (root).
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.