If you've visited here before you may want to jump straight to the latest additions:
For those of you who feel that security through obscurity is a good idea: I disagree. One reason I disagree is that at the moment of this writing there is a huge buzz about this security hole, but it is totally unclear how users can protect themselves against it. Much of the advise given (and even some proof of concepts) is just plain wrong and will only give those who follow it a false sense of security - much worse than no security but knowing it. Even worse, scared people can easily be lured into downloading an actual trojan advertising itself as a protective solution! Most of the main Mac press sites seem to just copy each other's crap without checking facts. (I suggest that, once you've read this page and understand the issue, you go back to those sources and see what they reported right and what they reported wrong. It doesn't hurt to know how much trust to put into which source the next time something is up...)
I could say "do this to protect yourself", but by leaving out an explanation I'd just be adding to the FUD. By explaining how this security exploit works people can understand how something would in fact protect them.
In any case, all that's here I found on the Net. All I did was separate the FUD from the good info. Sources I used, both the good and the bad:
One reason I bothered was the recent FUD about first Intego's "first Mac OS X trojan" (an executable disguised as a MP3 - whether it was a trojan or only a proof of concept is not clear), and right after that the FUD about MacWorld UK's "first/second Mac OS X trojan" (an AppleScript applet with an M$Office icon slapped on it, posing as M$Office installer... duh).
Then a week or so later this one turned up. I felt it was time to publish some actual information. I had seen too much FUD.
Being a professional AppleScripter I was also quite annoyed by all the totally unfounded fear of AppleScript that these zero-quality reports generated.
Sometime around the afternoon of Tuesday, May 18, 2004, I started coming across several reports about a supposed security hole in Mac OS X 10.3, or in Safari, or in Help Viewer, or in Mac OS X's disk:// URL scheme... Vagueness ruled. All of them screamed that a huge security hole was found, none of them explained the issue, all of them gave extremely vague instructions on how to protect yourself against this exploit. Including posting a script that couldn't possibly work as advertised.
Knowing that Mac OS' Help Viewer's help:runscript (which allows for clicking a hyperlink in a (HTML based) help page to have a local AppleScript script triggered) has existed for many years, predating Mac OS X, and that it can only run local scripts and that the remote Web page needs to provide the full path to the script, I couldn't see what the risk might possibly be. So I publicly showed scepticism. Luckily, a few people turned up who actually did know what they were talking about. Then it became clear that by combining help:runscript with several other techniques, there indeed is a security hole.
Since some incarnation of Mac OS X it handles a disk:// URL scheme (as used in the proof of concept below). To me, this seems to be the problem - the disk:// protocol not just fetches a ".dmg", it also mounts it! I'm not sure why I wasn't aware of this earlier. I sure as hell would have been uncomfortable about it. (I had never run into such a URL before and am not aware of Apple having advertised it. So far I haven't been able to find documentation on it.)
Thus an attacker can lure a victim into following a disk:// URL and then a help:runscript URL pointing to a malicious script on the by then locally mounted image.
The only reason the disk image is involved is that it allows for the attacker to know the full path to the malicious script (assuming the admin of the Mac hasn't changed the default mount point - I doubt many people have). The disk image serves no other purpose.
Extra sneakiness is possible if the victim's Web browser allows <FRAMES> and especially a META HTTP-EQUIV "Refresh" (most popular Web browsers do). The first may contain code that has the browser download the disk image (using a small frame, which most Web browser won't even show) so the user still thinks he's just looking at a page, unaware he downloaded something. The latter allows for some time to download the disk image and mount it, then refreshes the 'hidden' frame by loading the help:runscript URL pointing to the script on the now mounted disk image.
Proof of concept for that approach can be found elsewhere.
To keep the steps involved clear, I did not include the <FRAMES> or META HTTP-EQUIV "Refresh" approaches in this proof of concept. They are well-known enough anyway to be understood.
All the script in this proof of concept does is grab your short username and show you a dialog. Still, that's just my word. It's up to you to trust this page or not. (If you're smart, you don't trust me. Instead you use http to fetch the disk image I link to below, then mount it and use Script Editor to read the source code of the AppleScript that's on it. That way you know what will happen. No need for trust.)
Note: the only reason the disk image is 200KB is that hdiutil doesn't seem to let you create something inbetween 100 and 200KB :) The script itself is only 60KB so a 110KB disk image (allowing for a little overhead of the images itself) would have more than sufficed. The smaller the image, the faster it can all happen...
Some different approaches on how to protect yourself, in the order that I feel is most sensible:
disk:// protocol. People who know what they're doing may like this better than ParanoidAndroid, because LittleSnitch offers much more control. But because some people who think they know what they're doing don't, I'll spell it out: you will still need to disable Safari's "Open 'safe' files" option if LittleSnitch is the only protection you use!help: URL on to the system. Thanks to Smokey Ardisson and Arne Johannessen for pointing this out.help: protocol point to some other application than Help Viewer. Don't point to another Web browser, but to something that will not pass on the help: scheme to the OS. I suggest Chess.app. Of course this means some of Help Viewer's capabilities will not be available anymore - that's exactly the idea. Be warned that I orginally did this with MisFox and then when I tried to have it point to Help Viewer again that didn't work anymore. I don't know why, but I was able to get it working again with RCDefaultApp, possibly thanks to it knowing what the OS considers to be the defaults. That's why I now advice RCDefaultApp instead of MixFox :)disk:// URLs point to another program than diskimages-helper. I haven't tried, however several others else told me they did exactly this and it worked:sudo defaults write /System/Library/CoreServices/Help\ Viewer.app/Contents/Info NSAppleScriptEnabled -bool 'no'. To revert, use sudo defaults write /System/Library/CoreServices/Help\ Viewer.app/Contents/Info NSAppleScriptEnabled -bool 'yes'. (Note that on my system this changed the permissions of that file from 644 to 600. Make sure to check yours.) One reason I'm not confident this is 100% effective, is that if you have another copy of Help Viewer on a mounted disk somewhere, the OS may find and use that one instead. The same, applies to this next one:MacOpera doesn't support the Mac 'help:' scheme. It might be possible to enable it (if you dare) from 'Preferences > Programs and paths'. There is a reason why Opera (on any platform) doesn't enable by deafult passing random strings to the operating system for any registered scheme like 'irc:' or 'rtsp:' or 'edk:' or 'mms:' etc."Well, I can tell you that on my machine Opera is vulnerable. Both Opera 5 and 6.0.2. Not Opera 7.5, no. And no, none of this is about
passing random strings. It's about standard Mac OS behaviour that applications are expected to adhere to. (I consider the fact that iCab is immune a bug with a lucky side effect. A decent Mac app passes the help URL on to the system. It's up to the system to make sure nothing nasty can happen.)
sudo find / -name
OpnApp.scpt | grep "OpnApp.scpt" lists 314 on mine. Besides, you may be putting new copies in place without being aware of it (by instaling something or copying it from another disk). And then there is the (albeit minor I think) risk that making changes to such files may be something Installer.app does not anticipate, so next time you run an update it may give problems. This is the reasn I do not list Don't go there GURLfriend as a solution.help: scheme appear to refer to a (much less dangerous) telnet exploit. The only way in which it is related to 'our' security hole is that I think that this is not simply an Opera bug, because another browser that does not handle telnet:// URLs will simply hand it off to the system, which in turn will pass it on to whatever happens to be the default telnet client on your Mac. If that telnet client (which might be Opera, if you have it configured as your default telnet client) happens to be vulnerable, the attack succeeds, even if you were using another Web browser to begin with. Paranoid Android protects against this one too.