Security flaw with scripts in Mail.app
Wednesday, February 22nd, 2006
Heise Online has a report
outlining how the shell script execution flaw in Safari
also applies to Mail.app.
Both apps will execute scripts without asking permission in certain circumstances.
As the report explains:
It suffices to disguise a script with the ending “jpg” and assign the Terminal application for opening it. If this script is then sent in the AppleDouble format as an attachment, the information is passed along so that the recipient’s system also opens it with the Terminal.
Apple Mail displays the attachment with a JPG file symbol, but when users click on it, the script executes within Terminal without further prompting. This has been tested on Apple Mail 2 and Mac OS X 10.4. Older versions display a warning.
You can experience the flaw for yourself. The Heise Online site provides an example email which demonstrates the problem. It arrives with what looks like a JPG attachment. Clicking on the JPG file executes a harmless script in Terminal containing the command /bin/ls -al.
It’s in German, but enter your email address in the text box on this page
and click the button marked “Anfordern”. Then click on the link in the confirmation email and an example is on its way to you.
An immediate fix is to move Terminal into a different folder. The general fix, of course, is never to open attachments in emails that you are unsure about.
Thunderbird, the article points out, doesn’t fall for this trick.
Tags: Apple Mail, AppleDouble, attachments, bugs, mail.app, scripts, security flaw, Terminal

