Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Adversaries may modify file attributes and subvert Gatekeeper functionality to evade user prompts and execute untrusted programs.
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-21 | ✗→✓ | ▲ Improved | 10% | 0% |
| case-07 | ✓→✓ | = Same ✓ | 12% | 0% |
| case-02 | ✓→✓ | = Same ✓ | 119% | 0% |
| case-03 | ✓→✓ | = Same ✓ | 67% | 0% |
| case-04 | ✓→✓ | = Same ✓ | 63% | 0% |
> Sub-technique of: T1553
Adversaries may modify file attributes and subvert Gatekeeper functionality to evade user prompts and execute untrusted programs. Gatekeeper is a set of technologies that act as layer of Apple’s security model to ensure only trusted applications are executed on a host. Gatekeeper was built on top of File Quarantine in Snow Leopard (10.6, 2009) and has grown to include Code Signing, security policy compliance, Notarization, and more. Gatekeeper also treats applications running for the first time differently than reopened applications.
Based on an opt-in system, when files are downloaded an extended attribute (xattr) called com.apple.quarantine (also known as a quarantine flag) can be set on the file by the application performing the download. Launch Services opens the application in a suspended state. For first run applications with the quarantine flag set, Gatekeeper executes the following functions:
api.apple-cloudkit.com API, Gatekeeper reaches out to Apple servers to verify or pull down the notarization ticket and ensure the ticket is not revoked. Users can override notarization, which will result in a prompt of executing an “unauthorized app” and the security policy will be modified.Adversaries can subvert one or multiple security controls within Gatekeeper checks through logic errors (e.g. Exploitation for Defense Evasion), unchecked file types, and external libraries. For example, prior to macOS 13 Ventura, code signing and notarization checks were only conducted on first launch, allowing adversaries to write malicious executables to previously opened applications in order to bypass Gatekeeper security checks.
Applications and files loaded onto the system from a USB flash drive, optical disk, external hard drive, from a drive shared over the local network, or using the curl command may not set the quarantine flag. Additionally, it is possible to avoid setting the quarantine flag using Drive-by Compromise.
Platforms: macOS
The following tests are from Atomic Red Team and provide actionable ways to test this technique:
Gatekeeper Bypass via command line
Supported Platforms: macos
bashxattr -d com.apple.quarantine #{app_path}
If Atomic Red Team tests are not applicable, manually verify the technique by:
System settings can prevent applications from running that haven't been downloaded through the Apple Store which can help mitigate some of these issues.
| Finding | Severity | Impact | | -------------------------------------- | -------- | --------------- | | Gatekeeper Bypass technique applicable | High | Defense Evasion |
| CWE ID | Title | | ------- | ---------------------------- | | CWE-693 | Protection Mechanism Failure |
Other measured skills in the registry, with their headline benchmark lift.