Security Bug back for Leopard Mail

Hopper 100pxThe shell script security exploit exposed and then fixed in Tiger Mail has been reintroduced into Leopard Mail.

The loophole allows a sender to disguise an executable file (say, a shell script) as an image or some other harmless file. When clicked on, the executable file runs. Don’t remember? See the Hawk Wings post at the time (Feb, 2006).

Now, it’s back. You can test for yourself. The Heise Security web site offers to send you a test email. Give them an email address and after a confirmation, the email arrives:

Heissesecurityemail

CLick on the “jpg” to open it, and it runs a shell script, listing your current directory and exiting harmelessly:

Shellscript

Last time, the news prompted a range of responses, some of them rather hysterical. One writer even claimed that it made Mail.app too dangerous to use.

I am happy to follow John Gruber’s lead (again). As he said last time:

“It boils down to this: you can’t safely double-click files from untrusted sources, and you never could. This is no different today on Mac OS X 10.4 than it was a decade ago on Mac OS 8 and 9.”

Puzzling that it’s back, yes. But dangerous? No more than usual.

UPDATE: “FatYank” provides a quick fix in the comments for those who are really worried about this:

The workaround for this is to rename Terminal. When you rename Terminal and double click on the JPG, you get a message stating that Preview cannot open the file.

Or, as Rob points out, you could use Quickview to view attachments first, in which these “fake” file show up as empty.

Thanks!

[Via The Register ]

  • Digg
  • Facebook
  • Delicious
  • StumbleUpon
  • Evernote
  • Share/Bookmark
Tags: , , , , , , , ,

Related posts


16 Responses to “Security Bug back for Leopard Mail”

  1. Ben Ames says:

    I wonder if qc dropping has anything to do with the void left by Avie leaving Apple some time ago.

  2. Chucky says:

    “It boils down to this: you can’t safely double-click files from untrusted sources, and you never could. This is no different today on Mac OS X 10.4 than it was a decade ago on Mac OS 8 and 9.”

    I do wish Gruber was occasionally willing to not be quite such a fanboy. I love Apple too, but that doesn’t mean everything they do is right.

    If Apple’s built-in apps like Mail.app and Finder.app tell me an incoming file is a JPG or some other non-executable file, I very much do expect to be able to safely double-click on it.

  3. Tim Gaden says:

    Do you think Gruber is a fanboy? It would peg him as “critically loyal”.

  4. Chucky says:

    Don’t get me wrong. I read Gruber daily and enjoy his writing.

    But he seems to think of himself as acting as a counterbalance to the mindless Apple bashers out there. And that leads him to often act as a mindless Apple booster.

  5. Jasonian says:

    I don’t understand… this isn’t happening with me on my 10.5.0 Mail. When I get that email, double-clicking it in Mail or in Finder will put up a warning about having downloaded it from the Internet, that it will open in Terminal, and that it might not be safe.

    If I tell it to open, it’ll open in Terminal, just like I was told.

    Once you’ve allowed it once, it’ll keep opening without question. But there’s a warning first, just like there should be.

    Should you be able to fake an application up to look like a jpg? No, but at least there’s a warning now.

  6. Tim Gaden says:

    Hmmmm… Now I don’t understand. I am not getting any of those warnings in Leopard Mail.

  7. Michael says:

    Save the attachment, Tim, and look at it in Finder.

    If you choose “Get Info”, then under the “General” section you’ll see that Finder identifies the “Kind” as “JPEG image”.

    (You’ll see that the “Open with” section (if it’s visible) says “Terminal”.)

    Gruber will say what Gruber would say, but don’t you think it somewhat concerning that the OS *doesn’t know what it’s got*? Look at that file on a Linux machine and it is identified as type “plain text”.

    OS X doesn’t know what it’s got.

    To compound matters, although the OS is absolutely certain that it has a JPEG there, it will, nevertheless, blithely open the file, out of an email, in what is *not* what you’ve got set as the default editor for JPEGs.

    I’m sure they’ll patch it pretty soon, so that it will ask. But what if someone clicks “yes” meaning “no”? And, more broadly, I have to wonder why it’s asking such a stupid question in the first place?

    It would seem better if Apple made it so that their mail client couldn’t read this ridiculous “AppleDouble” encoding at all.

  8. Tim Gaden says:

    Sure, I understand how the trick works and that it is a flaw in Mail.app’s security.

    What puzzles me are two things – first, that some people are getting the Tiger-era alerts in Leopard Mail (so Jasonian suggests above) and, secondly, that people do not seem to exercise due caution with the content of their email and expect the mail client to make judgement calls about that is safe to open or not.

    I agree that Mail should be smarter about this — and as you say, soon will be again — but it should never be a user’s first line of defence. Common sense should be.

  9. FatYank says:

    The workaround for this is to rename Terminal. When you rename Terminal and double click on the JPG, you get a message stating that Preview cannot open the file.

  10. Rob says:

    The REAL workaround is to just use Quicklook instead of double-clicking on attachments.

    Quicklook shows the document as an empty file icon, so you’ll know its not really a JPEG.

    Seriously needs to be fixed though.

  11. Tim Gaden says:

    Rob, an excellent “Leopardy” solution!

  12. Chucky says:

    “and, secondly, that people do not seem to exercise due caution with the content of their email and expect the mail client to make judgement calls about that is safe to open or not.”

    The problem is that there are a number of historical PC worms that work by sending emails to people in your address book.

    If such a worm ever appeared on OS X, folks would get emails from trusted addresses, with links to innocent seeming JPG’s. At that point, a lot of folks with perfectly good judgment would double click the JPG, and have hell break loose on their machine.

    Trusting Mail.app and Finder.app to give you accurate information about what you’re dealing with and what the consequences of double clicking might be is crucial to protecting folks with perfectly good judgment.

  13. Wayne says:

    Yes, Chucky has it: the email you receive may APPEAR to be from a trusted source. With a title like, “I have a daughter!” or “Jan and me on the pier” or “This comic pretty much sums up my life right now.” or something that might lead you to instinctively click to see. After all, it is from someone you know.

    Remember, mail can easily be forged, and as Chucky points out, it would not be hard to have that JPG you click on send emails to 5 of your address book entries to pass it on.

  14. Hugin777 says:

    On my PowerBook it always runs though unnoticed at the first click, but shows the warning dialog for subsequent clicks.
      If I download the attachment first the warning always shows.

    To try this more than once you have to delete the file from Library/Mail Downloads each time…

    I have a PowerBook 1,25GHz running an all updated 10.5.1. Perhaps my machine is too slow to write the extended attributes before it’s already running the first time :-)

  15. Thor says:

    Hmm. On my clean install of Leopard, I get this warning when double-clicking the attachment:

    ““Heise.jpg” may be an application. It was attached to a mail message and will be opened by Terminal. Are you sure you want to open it?”

    I find this to be sufficient warning, but I don’t understand why everyone is not getting this warning. In any event, it is not clear that the “security shell exploit has been reintroduced.”

  16. There is no such thing as a safe file. :)

Leave a Reply