Cybersecurity specialists have discovered a critical flaw in the protection system of Apple's macOS operating system. Researchers have demonstrated that applications downloaded from sources other than the official App Store can be silently replaced by malicious doppelgangers. This casts doubt on the effectiveness of the Gatekeeper technology, which is designed to protect users from unverified software.
How the protection works and where it fails
According to Apple's official documentation, the Gatekeeper mechanism checks any software, plugin, or installer obtained outside the App Store. The system must ensure that the software was released by a verified developer, certified by Apple as safe, and has not been modified after signing. However, in practice, researchers have found a way to bypass these checks.
An attacker can silently replace the main executable file of any application downloaded from the internet. Implementing this attack does not require elevated privileges or administrator rights—code execution capabilities at the standard user level are sufficient. This could be a malicious application or script already running on the device.
Attack mechanics and vulnerable programs
The essence of the vulnerability lies in the fact that Gatekeeper does not sufficiently control access to files after their initial download. This attack method is not applicable to apps from the Mac App Store, as they run with root privileges, and a user-level process cannot overwrite them. Programs installed from third-party sources remain at risk.
Potentially vulnerable applications include popular tools such as:
- Brave browser;
- Slack and Signal messengers;
- Visual Studio Code code editor.
For a successful attack, the application must be downloaded from a third-party source and launched at least once.
Bypassing security checks
Gatekeeper performs an initial check of the application to prevent subsequent modification. However, researchers have shown that a downloaded application can be placed in a TAR archive, the original removed, and replaced with a malicious version. After this, macOS will not require re-authorization, as the package will be considered locally created and exempt from verification.
Such an attack can be implemented in several ways: via command-line tools, through a malicious request to an AI agent, or via a supply chain attack using package managers like npm, brew, and others.
Apple's response and expert conclusions
The Gatekeeper technology should check applications when their digital signature changes, but in practice, this does not happen. Apple has not yet explained why the system allows such changes. Researchers suspect the problem lies in caching the trust value: if the check was initialized, the "evil twin" of a legitimate application successfully passes verification based on the saved data.