CVE-2022-22616: Simple way to bypass GateKeeper, hidden for years
Safari's automatic decompression of gzip files dropped the com.apple.quarantine extended attribute, so a downloaded app bundle could be opened without the usual GateKeeper warning. An attacker could therefore get a user to run an unsigned or unnotarised application with no security prompt.
Published on jhftss.github.io
In this writeup, I will introduce a very simple method to bypass GateKeeper , and uncover the root cause through reversing and debugging. Apple had already addressed it as CVE-2022-22616 in macOS Monterey 12.3, and credited the bug to two Jamf researchers (@malwarezoo, @jbradley89) and me.
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
The gzip unarchiver in Safari's SandboxBroker wrote the decompressed file to disk without copying the quarantine extended attribute from the original download.
Impact
A downloaded app could run without the GateKeeper prompt, though the user still has to open the extracted app themselves.
What the attacker needed
MacOS before 12.3; victim downloads a gzip file in Safari; victim opens the extracted app
The fix
Apple fixed it in macOS 12.3 by copying the quarantine properties during decompression.
How it was found
- Create an app bundle containing a script that launches another application.
- Zip the bundle and then gzip the zip file.
- Download the gzip file using Safari so macOS decompresses it automatically.
- Open the extracted app, which runs without any GateKeeper prompt.
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.
GateKeeper is a macOS feature that warns you before opening downloaded software that Apple has not checked. macOS marks downloaded files with a hidden label so GateKeeper knows to check them. Here, unpacking a gzip file removed that label, so the app inside looked like it had never been downloaded and opened without any warning.
What is Misconfiguration?
Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.