Gatekeeper (macOS)
Security feature of macOS
title: "Gatekeeper (macOS)" type: doc version: 1 created: 2026-02-28 author: "Wikipedia contributors" status: active scope: public tags: ["macos-security-technology"] description: "Security feature of macOS" topic_path: "technology/operating-systems" source: "https://en.wikipedia.org/wiki/Gatekeeper_(macOS)" license: "CC BY-SA 4.0" wikipedia_page_id: 0 wikipedia_revision_id: 0
::summary Security feature of macOS ::
::data[format=table title="Infobox software"]
| Field | Value |
|---|---|
| name | Gatekeeper |
| logo | Gatekeeper logo.png |
| developer | Apple Inc. |
| released | |
| operating system | macOS |
| :: |
::callout[type=note] Not to be confused with the third-party extension Gatekeeper by Chris Johnson for [[Classic Mac OS ::
| name = Gatekeeper | logo = Gatekeeper logo.png | developer = Apple Inc. | released = | operating system = macOS Gatekeeper is a security feature of the macOS operating system by Apple. It enforces code signing and verifies downloaded applications before allowing them to run, thereby reducing the likelihood of inadvertently executing malware. Gatekeeper builds upon File Quarantine, which was introduced in Mac OS X Leopard (10.5) and expanded in Mac OS X Snow Leopard (10.6). The feature originated in version 10.7.3 of Mac OS X Lion as the command-line utility . A graphical user interface was originally added in OS X Mountain Lion (10.8) but was backported to Lion with the 10.7.5 update.
Functions
Configuration
::figure[src="https://upload.wikimedia.org/wikipedia/commons/e/eb/Gatekeeper.png" caption="Gatekeeper options in the [[System Preferences]] application. Since [[macOS Sierra]], the "Anywhere" option is hidden by default." alt="Screenshot of the System Preferences application of OS X Yosemite, showing the three Gatekeeper options as radio buttons."] ::
In the security & privacy panel of System Preferences, the user has three options, allowing apps downloaded from:
The command-line utility provides granular controls, such as custom rules and individual or blanket permissions, as well as an option to turn Gatekeeper off.
Quarantine
Upon download of an application, a particular extended file attribute ("quarantine flag") can be added to the downloaded file. This attribute is added by the application that downloads the file, such as a web browser or email client, but is not usually added by common BitTorrent client software, such as Transmission, and application developers will need to implement this feature into their applications and is not implemented by the system. The system can also force this behavior upon individual applications using a signature-based system named Xprotect.
Execution
::figure[src="https://upload.wikimedia.org/wikipedia/commons/1/16/Gatekeeper_alert.png" caption="alert]] that appears when Gatekeeper prevents an application from running, because it was not signed by an Apple certified developer" alt="Screenshot of a system alert, informing the user that the application cannot be opened, because it was not signed by a registered developer."] ::
When the user attempts to open an application with such an attribute, the system will postpone the execution and verify whether it:
- is blacklisted,
- is code-signed by Apple or a certified developer, or
- has code-signed contents that still match the signature.
Since Mac OS X Snow Leopard, the system keeps two blacklists to identify known malware or insecure software. The blacklists are updated periodically. If the application is blacklisted, then File Quarantine will refuse to open it and recommend that the user drag it to Trash.
Gatekeeper will refuse to open the application if the code-signing requirements are not met. Apple can revoke the developer's certificate with which the application was signed and prevent further distribution.
Once an application has passed File Quarantine or Gatekeeper, it will be allowed to run normally and will not be verified again.
Override
To override Gatekeeper, the user (acting as an administrator) either has to switch to a more lenient policy from the security & privacy panel of System Preferences or authorize a manual override for a particular application, either by opening the application from the context menu or by adding it with . Starting with macOS 15 (Sequoia) the user additionally has to go to "System Settings / Privacy & Security" then scroll down to the bottom and select "Open Anyway".
Path randomization
Developers can sign disk images that can be verified as a unit by the system. In macOS Sierra, this allows developers to guarantee the integrity of all bundled files and prevent attackers from infecting and subsequently redistributing them. In addition, "path randomization" executes application bundles from a random, hidden path and prevents them from accessing external files relative to their location. This feature is turned off if the application bundle originated from a signed installer package or disk image or if the user manually moved the application without any other files to another directory.
Implications
The effectiveness and rationale of Gatekeeper in combating malware have been acknowledged, but been met with reservations. Security researcher Chris Miller noted that Gatekeeper will verify the developer certificate and consult the known-malware list only when the application is first opened. Malware that already passed Gatekeeper will not be stopped. In addition, Gatekeeper will only verify applications that have the quarantine flag. As this flag is added by other applications and not by the system, any neglect or failure to do so does not trigger Gatekeeper. According to security blogger Thomas Reed, BitTorrent clients are frequent offenders of this. The flag is also not added if the application came from a different source, like network shares and USB flash drives. Questions have also been raised about the registration process to acquire a developer certificate and the prospect of certificate theft.
In September 2015, security researcher Patrick Wardle wrote about another shortcoming that concerns applications that are distributed with external files, such as libraries or even HTML files that can contain JavaScript. An attacker can manipulate those files and through them exploit a vulnerability in the signed application. The application and its external files can then be redistributed, while leaving the original signature of the application bundle itself intact. As Gatekeeper does not verify such individual files, the security can be compromised. With path randomization and signed disk images, Apple provided mechanisms to mitigate this issue in macOS Sierra.
In 2021, a vulnerability was discovered where putting [#!](shebang-unix) on the first line (without the path of the interpreter) of a file bypassed Gatekeeper.
In 2022, a Microsoft researcher shared a vulnerability that abuses the AppleDouble format to set an arbitrary access-control list to bypass Gatekeeper.{{Cite web |last=Gatlan |first=Sergiu |date=December 19, 2022 |title=Microsoft: Achilles macOS bug lets hackers bypass Gatekeeper |url=https://www.bleepingcomputer.com/news/security/microsoft-achilles-macos-bug-lets-hackers-bypass-gatekeeper/ |access-date=2022-12-19 |website=Bleeping Computer |language=en-us}}
References
References
- (February 13, 2015). "OS X: About Gatekeeper".
- Siegler, MG. (February 16, 2012). "Surprise! OS X Mountain Lion Roars Into Existence (For Developers Today, Everyone This Summer)". AOL Inc..
- Siracusa, John. (July 25, 2012). "OS X 10.8 Mountain Lion: the Ars Technica review".
- Reed, Thomas. (April 25, 2014). "Mac Malware Guide : How does Mac OS X protect me?".
- Ullrich, Johannes. (February 22, 2012). "How to test OS X Mountain Lion's Gatekeeper in Lion".
- "spctl(8)". Apple.
- (February 13, 2015). "About the OS X Lion v10.7.5 Update".
- (June 15, 2016). "What's New in Security".
- Cunningham, Andrew. (June 15, 2016). "Some nerdy changes in macOS and iOS 10: RAW shooting, a harsher Gatekeeper, more".
- Reed, Thomas. (October 6, 2015). "Bypassing Apple's Gatekeeper".
- Moren, Dan. (August 26, 2009). "Inside Snow Leopard's hidden malware protection".
- (March 22, 2016). "About the 'Are you sure you want to open it?' alert (File Quarantine / Known Malware Detection) in OS X".
- Foresman, Chris. (February 17, 2012). "Mac developers: Gatekeeper is a concern, but still gives power users control".
- Chatterjee, Surojit. (February 21, 2012). "OS X Mountain Lion Gatekeeper: Can it Really Keep Malware Out?". [[International Business Times]].
- Goodin, Dan. (September 30, 2015). "Drop-dead simple exploit completely bypasses Mac's malware Gatekeeper".
- Gatlan, Sergiu. (December 23, 2021). "Apple fixes macOS security flaw behind Gatekeeper bypass".
::callout[type=info title="Wikipedia Source"] This article was imported from Wikipedia and is available under the Creative Commons Attribution-ShareAlike 4.0 License. Content has been adapted to SurfDoc format. Original contributors can be found on the article history page. ::