Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Wowfunhappy

macrumors 68000
Original poster
Mar 12, 2019
1,745
2,087
Last night, I was reading a story on Hacker News about a security vulnerability that kind of scared me. https://mikko-kenttala.medium.com/zero-click-vulnerability-in-apples-macos-mail-59e0c14b106c It's worth reading, but the gist, as I understand it, is as follows.
  • If Apple Mail sees an email with an attached zip file and some special metadata, it will extract the zip file automatically. The user does not have to do anything.
  • Because Apple Mail doesn't handle symlinks properly, a zip file could overwrite any other file in Apple Mail's sandbox with its own version when extracted
  • The list of mail rules is stored inside of Apple Mail's sandbox.
Suffice to say, this is the kind of security vulnerability that legitimately scares me! Taken together, someone could force your computer to forward all your email to their address, just by sending you a message which you never even open.

Apple fixed the problem last summer in High Sierra and newer†, but I'm running Mavericks. So I spent some time this morning writing a SIMBL plugin to remove the underlying problem, which is that Apple Mail will automatically extract certain zip files. That was always a disaster waiting to happen.


It's only a few lines of code, so I think it will possibly maybe probably work on anything newer than 10.6, but I've only tested it on 10.9. SIMBL is required.

SIMBL is an open source framework for injecting code into Cocoa apps. Over the years, developers have created different versions of SIMBL for different versions of OS X. I generally recommend:
For versions of SIMBL which don't include a UI, install plugins by copying them to /Library/Application Support/SIMBL/Plugins/.

After installing the plugin, restart Apple Mail. You'll know that it's working if you can email yourself a folder (drag a folder into the compose window) and it arrives as a zip file rather than a folder. (Hint: it isn't actually possible to attach folders to an email, which is why this feature existed in the first place.)

Please note: I made this today in 90 minutes, between the time I woke up and the time I had to start work. I believe it will fix the vulnerability, but if I'm wrong somehow and you get hacked anyway, I accept zero responsibility. 🙂

Anyway, just wanted to share. Hopefully it works and is useful, and I didn't scare anyone too much. There are of course other vulnerabilities in old software, but most of them don't worry me like this one did.

† Apple's update did not, however, actually stop Mail from automatically extracting zip files, so expect this to come back at some point...
 
Last edited:

otetzone

macrumors regular
Jul 12, 2019
158
17
@Wowfunhappy
Could you please tell where MailSecureFix.bundle file should be placed? MacintoshHD/Applications/Mail/Contents/Plugins?
I have installed SIMBL prior to that of course.
 
Last edited:

Wowfunhappy

macrumors 68000
Original poster
Mar 12, 2019
1,745
2,087
Sorry, I guess it wasn’t prominent enough in the first post! It's a SIMBL plugin, so it goes in /Library/Application Support/SIMBL/Plugins/.
 
Last edited:
  • Like
Reactions: otetzone
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.