loading
Loading content
loading
Vulnerable macOS installers at scale: how Trickest workflows found hundreds of .pkg files affected by CVE-2024-27301 and CVE-2024-27822.

Carlos Polop · Cloud Pentesting Team Leader
As a pentester, whenever you discover a new type of vulnerability, you're always curious about its real impact. This was the case with the vulnerability CVE-2024-27822 I discovered, which affected hundreds of macOS installers.
This vulnerability allowed abuse of third-party installers to escalate privileges to root without needing the user's password.
To understand how widespread this issue was, I used the Trickest to build workflows and automate the discovery of vulnerable installers.
First, I needed a way to identify vulnerable macOS installers. The process was straightforward:
preinstall.sh and postinstall.sh) with root privileges.pkg) inside the Scripts folder#!/bin/zsh, they could execute $HOME/.zshenv as root, leading to arbitrary code executionWith this knowledge, I set out to find as many .pkg macOS installers as possible, decompress them, and check for scripts using the shebang #!/bin/zsh.
The first method involved scraping GitHub for macOS installers. Previously, I used Trickest to parse 10TB of GitHub logs and categorize millions of repositories.
Using these URLs, I created a Trickest workflow that utilized the GitHub GraphQL API to search for .pkg files in releases and return their URLs.
The workflow:
.pkg files and return their URLsWith 5 machines and the powerful scalable execution engine, it took only half an hour to gather URLs to .pkg files from millions of GitHub repositories, resulting in a few dozen URLs.
This idea came from Nenad, the CEO of Trickest. He suggested scraping itunes.apple.com for application URLs and then scraping these websites for .pkg files.
We created a Trickest workflow to:
itunes.apple.com.pkg filesUsing 10 machines, we obtained a few hundred URLs to .pkg files in 5 hours.
With hundreds of .pkg URLs, it was time to download, decompress, and search for scripts with the shebang #!/bin/zsh. If found, the installer was vulnerable.
We created a simple Trickest workflow:
This workflow:
Running this workflow with 6 machines in parallel took only about 6 minutes.
After running these workflows, we discovered over a hundred installers vulnerable to privilege escalation. This exercise and results demonstrated how Trickest can effectively uncover vulnerable assets.
I reported the identified vulnerability to the relevant companies and Apple. Initially, I directly contacted the companies, presuming it to be a misconfiguration that they could rectify autonomously. However, subsequent discussions led me to report the issue to Apple, in consideration of a potential OS-level resolution.
Several CVEs and advisories were released:
After Apple clarified that they would fix the issue, no more advisories or CVEs were requested, and no more companies were contacted about the issue.
Get a personalized demo
A 30-minute walkthrough. We map the platform to your stack and answer pricing and deployment questions for your environment.