Safari Falls Victim to Remote Code Exploit
A user writes, "A new vulnerability has been found in Mac OS X's Safari, which will launch Help.app and run an arbitrary script with a URL like 'help:runscript=...', assuming a known path (which is possible when Safari is set to automount disk images (which is the default)). A nice working demonstration is available on insecure.ws while the incident has been reported on Full-Disclosure."
"help:runscript=..."
No double-decode, unicode obfuscation, or CMD.EXE parms. Even the exploits are user-friendly!
I'm switching to Windows!
omg no!! wat wil i do?
some1 help meeeeeeee!!!!!!!
\@O@/
I'm all for calling Apple out on security violations when they deserve it (especially since there have been some awfully generous and inaccurate security claims about Mac OS X), but if there was a Slashdot story for every exploit against a web browser, we'd be reading nothing else.
If it was exploitable and used in an *email* client (a la Outlook using the MSIE rendering engine), *then* I could see some serious cause for concern, as the worm potential is severe.
However, this is ultimately a client-level attack that requires the user to pull down malicious data. It just isn't a big deal.
May we never see th
That is one big hole. Frick.
... guess this would give me a way to find out.
I was just today wondering what the keylogging potential was for Safari
GAH!
; -- the corruption of government starts with its secrets. a truly free people keep no secrets. --
First signs that apple's really in competition with Microsoft
From the bulletin:
---------------
This can potentially wipe the entire hard-disk (or large parts of it),
if a hacker runs a script with "rm -rf
---------------
Unless this has a built-in privilege escalation, I don't see how this is true. If it just runs as the user (which it appears to) then you could erase the users information that way, but not the disk.
Integrate Keynote and LaTeX
can someone please explain how this exploit made it into the browser. This seems so blindingly obvious. In fact, this seems like intended behavior.
Photos.
According to a forum post on MacNN, this has been known since February...
"Democracy is three wolves and a sheep voting on what to have for dinner."
I get the impression (only from the /. blurb so far) that this hole is, by orders of magnitude, more serious than anything reported for Mac OS X previously.
Most "vulnerabilites" previously reported for Mac OS X have been largely theoretical, obscure, and hardly any real threat (at least, when compared to the pretty high threshold of threat before anyting is considered a "flaw" in the Windows world).
Don't misunderstand, more serious stuff than this is pretty much standard fare for Windows (and sometimes on UNIX/Linux to, cf. "wu-ftpd", "bind", and "sendmail") - but for the Mac OS X platform, a flaw as "exploitable" as this is pretty unique.
'Course, if will probably be taken care of within a few days via "software update", if not already.
-tor
http://www.mozilla.org/projects/camino/
...
IMHO the best Mac OS X browser out there, even more so than Safari. Faster, per-site cookie policies, per-site popup blocking,
Be sure to get the latest snapshot release (updated daily), as the 0.7 release is getting a bit old.
Tts look and feel is more consistent with other Mac OS X apps (such as Mail.app) than Safari. (Safari looks more like a Finder window.)
...I'd been thinking about kicking Safari to the curb in favor of Firefox for a while now anyway. Seems like a pretty good impetus to finally do so.
Not that I'm jerking any knees or anything, I'm just so used to using Firefox on Windows all day at work that I miss some of it's functionality when I get home. This gives me a convenient excuse to make the switch. :)
I downloaded MisFox 1.2.1 and changed the Help Protocol Helper to Chess. For good measure I unchecked "Open 'safe' files after downloading" in the general preferences of Safari.
If you disagree then it must be overrated, redundant or trolling.
I SO GLAD MY TRS-80 COCO ISENT
VULNERABLE TO THIS. ALL YOU PE
OPLE WITH FANCY GUI COMPUTERS
WILL REGRET IT SOME DAY.
OK
?
OK
?
(Lameness filter encountered. Post aborted!
Reason: Don't use so many caps. It's like YELLING.)
Moneyed corporations, non-working 'poor' and criminal prisoners are turning productive citizens into tax-slaves.
Jesus, pudge, you reject my story where it is mentioned that YOU DON'T NEED AUTO OPENING OF "SAFE FILES" TURNED ON FOR THIS TO WORK and then post some lame arse submission that gets it wrong.
.help extension to the chess app) and a link where to get software to do this (because you can't do it from the GUI in OSX as you could in OS9).
Fact 1. Using the disk:// URL type, and sticking it in a Meta refresh tag, you can remotely mount a disk image without the user even knowing. It DOES NOT need auto open of safe files to be turned on.
Fact 2. If the disk image is small, which it would be if there's only an Applescript on it with 'do shellscript="rm -rf~/*" ', then getting the user to click on a link that runs the script a few seconds later is easy and you could even do it via javascript and automate the whole thing.
Fact 3. Pudge your sarcastic "from the let's publish it so everyone knows who to do it" is a blatant stupidity. Jesus fuck. This vulnerability was on Heise.de on Saturday. It may be news to you, pudge, but one hell of a lot of people read and visit heise's site. Not everyone is an English only American.
Fact 4. And this makes me especially mad at you, you clown, for using this submission instead of mine, is that I submitted a workaround (point the
Grow up pudge and use your brains instead of your zealotry.
this exploit also works in Camino as far as I can tell (although I didn't have it set to automount images) using recenet nightly build. I also tried it in IE and it was able to open Help.app without problems..
Help-team: let's base our help app on html, which is the de-facto standard markup language now. Oh, and let's give it the ability to launch scripts, so we can give live demo's in the help files.
Browser-team: of course we're not going to let scripts with full user-privileges run from within the browser by default, that's idiotic. Who do you think we are, Microsoft? Hey, the help app is based on html right? Let's stick a help: protocol in the URL handler, that would be convenient.
I think you can. Find a .help file, right-click, open with..., navigate to chess app, click check-box "always open with."
But maybe I misunderstood.
You misunderstood.
.help files (those don't even exist on Mac OS X) to something else is of no use. You need to set the help: protocol to something else than Help Viewer.
Setting
I have not been able to recreate this exploit in OS X 10.2.8.
Apparently, only versions 10.3.x are affected.
Karma: Chevy Kavalierma.
Well, he only misunderstood because the guy he is responding to was incorrect: he is the one that mentioned .help extensions, instead of the help: protocol.
Also, MSIE allows changing it, and it is included with Mac OS X (though yes, lack of real UI access to these prefs is a big problem).
Here's where you can get a utility that allows you to change these settings: More Internet - http://www.monkeyfood.com/software/moreInternet/
The vulnerability was first discovered in Opera, and was later found to also exist in Konqueror of KDE fame. Since Safari is based on the Konqueror code, that's probably where it came from.
-
sig sig sputnik
As to your Facts 1, 2 and 4: The submission was not incorrect, it merely didn't contain all the information. Instead, we linked to all the information, which is what we do on Slashdot. Sorry if you don't like it (not not really), and boo-hoo that didn't get your name in lights.
And your Fact 4 is not a workaround as you claim, it is a way to disable Help, which causes its own problem.
As to your Fact 3: you missed the point: I was criticizing the publication of the exploit, not stories about the exploit. Perhaps Apple was at fault for not contacting the people who submitted it, I don't know. I don't have enough information to tell. The only thing I do know is that this is the wrong way to do it; whose fault it is, I can't tell.
Because you apparently don't understand, and since I am such a nice, bright, guy, I'll explain: when you find an exploit, you should notify the people who can fix it (i.e., Apple). Apple should get back to you, and keep you apprised of the situation, and if Apple follows through with all this, you should NOT release the information to the public until it has been fixed. Whether Apple received the initial exploit report, or responded, is not clear (though it wouldn't surprise me if they did receive it, and did not respond). But again, clearly, this was not released the way it should have been, and that was my point.
> And your Fact 4 is not a workaround as you claim, it is a way to disable Help, which causes its own problem.
Uh, that's exactly what a workaround is: a temporary solution that might cause loss of functionality. If it didn't, it would be as good as the final solution. (E.g., a workaround for the various DCOM exploits on Windows is to disable DCOM in the registry).
> Whether Apple received the initial exploit report, or responded, is not clear
According to the thread in macnn, Apple has been aware of this at least since Februari, but hasn't said or done anything so far.
hey safari users, click ~/poop.txt">here! and watch in amazement as.. NOTHING HAPPENS! what this should've done is created a list of your root directory and put it in ~/poop.txt .. but it didn't, why? because it has to be an apple script that exists.. now if apple has an applescript that erases stuff in the same path on every install, that'd be one thing, but what this proof of concept showed is that you have to know the path to the script, and the script has to do something.
That's why they had you download and automount the dmg, so on every OS X install the path would be /Volumes/0x04_script/0x04_script.term .. otherwise, it's pretty well useless.
You have get the user to download the code by themselves before you may execute it.
Yes, it's a bad exploit and they sure as hell better fix it but I set my DMGs to not automount a LONG TIME AGO.
Latewire
According to the thread in macnn, Apple has been aware of this at least since Februari, but hasn't said or done anything so far.
...
And since Apple did not respond, how does anyone know they were aware of it? Question everything
Normally, people who don't get 'their' submission accepted are the biggest whiners on Slashdot, so I'd be on your side.
However, if it is true that you don't need have "auto opening of safe files" turned on, then you have done a lot of your Mac-using readers a disservice (eg: these.) How about a quick correction?
None are more hopelessly enslaved than those who falsely believe they are free. Johann Wolfgang von Goethe.
This hint was taken directly from the article...
Blatant karma whore!
You can find an application to fix the remote exploit here:
MisFox
Tab to the Protocol Helpers, find help:, choose a different application. I used TextEdit.
You can verify that the exploit is disabled by cutting and pasting the following to your Safari Address Bar:
help:runscript=../../Scripts/Info Scripts/Current Date & Time.scpt
TextEdit runs, but the (harmless) script doesn't.
1. YOUR submission was incorrect! This vulnerability works in ALL browsers!
2. The workaround IS a goddamn workaround and IT DOES work, and IT DOESN't disable help! Jesus almighty, try it out, it merely disable running help from the browser, not running help from an application.
3. Apple was warned TWO MONTHS ago about this vulnerability! It was openly published on Heise on Saturday. It was all over Mac forums in Germany and the US over the weekend.
4. Since it was openly known (and with no response from Apple for two months), you nice bright guy, I decided to submit a COMPLETE story with a working workaround (it really does work pudge) in order to help Mac users protect themselves, not because of wanting to be in anyone's highlights.
I am going to mail Taco about this pudge. You are guilty, IMO, of neglecting a very serious security vulnerability on OSX, and then neglecting to actually check the facts and then finally post a story that does only helps the knowledge of the exploit spread but with no help to users, and that soley because YOU do not agree with a FACT (it was already known). Disgusting.
I wonder if this is possible from OS X mail also. Mail uses webcore to render html and probably shares some settings. The downloading of the dmg is provoked by a meta tag, so unless mail strips meta info from e-mail then this could affect mail as well. That eventuality could potentially be a much larger issue than the current method of execution. Especially since mail will render html and images unless the mail is marked junk.
There has already been a minor flame war on MacNN over this. lixlpixel has spent some effort to make Apple aware of the issue, so you're left with two options: either Apple reacts rather slowly, or it's pretty hard to make Apple aware of the issue.
The current submission is not incorrect. It states the fact that automounting images can allow a known path to a script. It doesn't say there are not other methods for getting a known path to a script; it doesn't even imply it. This guy mentioned one additional method, and there are likely others. If I give his method, then people disable disk: protocol; then what? It's a false sense of security, since the path is not the real problem, it is Help Viewer that is the problem.
> If I give his method, then people disable disk: protocol; then what?
.dmg's I bet they would also like to know about (and disable) automounting through disk://.
Actually that would be a very good thing. If people conciously disabled autolaunching
As for the current information, the only known exploit is with Apple's help: protocol. Disabling the help: protocol from the browser, which is surely not that important does plug that remote exploit.
Many people are looking to make sure that this kind of exploit isn't possible from another proprietary protocol handler. If another one shows up, I'm sure the information will be available quickly.
You can "Get Info" and reassociate .term files to BBEdit for the time being...it kills remote terminal calls in OS X.
It's not a fix, but it'll keep the more heinous stuff from wreaking havok until a patch is applied...
If you're half as beautiful naked, you'd be 4 times as beautiful with twice as many clothes on.
> Also, MSIE allows changing it, and it is included with Mac OS X
Using MSIE to workaround an OS X security issue, imagine that!
I knew there was a reason that the word 'safe' was quoted in the General tab in Safari's preferences. I guess that same reason is why deselected it...
This doesn't solve the problem, I know, but does lessen it's severity somewhat.
I have no trouble believing this. I made it clear I was not blaming anyone in particular, but noting that it was the situation that was problematic. If Apple is to blame, so be it, but I don't feel confident in asserting that.
Am I the only one who doesn't keep ANY files in my home directory? All of my files of importance are encrypted in folders on the root of my hard drive. I've come to realize that the Home directory is is what most viruses, or malicouse code will attempt to attack, so, why put files there? Just because it's the default, doesn't mean you have to use it.
It'd be like keeping all of your documents in the documents folder. How many people actually do that?
You didn't make anything clear, pudge. The impression you gave me is that you prefer Apple's reputation over mac user's security. And that is why I am as mad as hell.
It's the OS that handles the help: protocol and delegates it to whatever app is assigned, regardless of what browser you're using.
I'm too lazy to try and implement this, but what you could do is write an AppleScript to receive all calls to the help protocol. So whenever there's a help: URL, your little AppleScript goes up, notifying you that something is trying to open a help: URL, which is a security vulnerability. Then either allow or deny. If the user allows it, pass the URL along to Help Viewer.app. Then just use something like MoreInternet to point the help: protocol to that script.
Like I said though, I'm too lazy to try it right now.
The proof of concept also runs from the OmniWeb 5 Beta and Internet Explorer 5.2.
It could also run from FireFox although because FireFox checks to see if you really want to download an executable, help tries to run the script before it's actually there.
It fails in Opera with the error "The address type is unknown or unsupported."
Those are all the browsers I have to check on.
It's not just dmgs that cause the problem. Check out the (fortunately harmless) site here:h is is as serious and critical as they get, and it's not limited to any browser. They're all affected.
http://bronosky.com/pub/AppleScript.htm
T
"I like systems, their application excepted", George Sand (French)
This is much more serious than the articles let on. This security vulnerability in MacOS X affects all web browsers. There's a non-malicious example of the seriousness of the problem here:h at just runs a harmless script (/usr/bin/du; exit) which scrolls a bunch of text and looks scary, but it could easily have been a script to wipe your home directory, and you could have had some serious data loss (i.e. rm -rf ~/).
/Library/Documentation/Help). This will prevent people from linking to the script runner. This vulnerability is very serious, and doesn't even have to involve downloading a DMG. Once the "Help" folder is renamed, you won't be able to use the Mac Help center anymore, but at least you will not be at risk of having your data wiped by clicking on a link, or visiting a malicious site. DO THIS NOW!!!!!
http://bronosky.com/pub/AppleScript.htm
T
To fix the vulnerability, simply navigate to your MaOS X drive, go to the Library folder (not the one in your home folder, but the one in the root directory of your HD), and then to the Documentation folder, and rename the folder "Help" to something else (located at
"I like systems, their application excepted", George Sand (French)
I'd like to announce the unveiling of my new website, http://www.iwilltotallyhax0ryourmac.com/evil_page. htm
, I'll explain: when you find an exploit, you should notify the people who can fix it (i.e., Apple). Apple should get back to you, and keep you apprised of the situation, and if Apple follows through with all this, you should NOT release the information to the public until it has been fixed.
To a point. If the odds are good that someone else already knows about this exploit, and the people who can fix it (i.e. Apple) haven't done anything about it even though they knew about it in February, you should release info. Especially since there are several ways of protecting yourself without waiting around for a patch.
Then again, I'm an Open Source advocate, and every OS vuln solved through full disclosure.
The default settings for the DiskImages.framework is located here: /System/Library/PrivateFrameworks/DiskImages.frame work/Versions/A/Resources/defaults.plist
/Volumes/ to whatever one likes, say /Users/MyAccount/
One can change an interesting setting called "force-idme" from the standard "no" to "yes" and the DiskImages.framework will treat the diskimage as if it was an "internet-enabled disk image." What this means is that it will mount the diskimage, copy it to the current directory as a folder then un-mount and then moves the disk image to the trash. There, the exploit no longer has a known location to work with. Another setting just happens to be "mount-point" which can also be changed from the default
Like the subject line says, simple fix.
NarratorDan
"If you're not confused by quantum mechanics, you really don't understand it." - Niels Bohr
What I am referring to is the RFPolicy which does encourage full disclosure, however: "Provided you cooperate with the researcher and keep them 'in the loop', they should provide you with whatever time necessary to resolve the ISSUE." This is what I am referring to: if the issue is disclosed without being resolved, then someone has dropped the ball. Yes, if Apple doesn't "do anything about it," it could be disclosed, but that just means the process has broken down.
I am licensed Omniweb 5 user, using latest beta.
:)
There is downloads in preferences and there is "edit safe applications list", from there I removed Help viewer and Disk Image mounter.
The concept worked, Help application opened but Disk image was not mounted.
I mailed them already about what to do about this exploit but I don't think they are awake now
ltns Pudge ;)
;)
:)))
If you have read what happened to poor French company "Intego" proving there can be a serious security problem about how finder deals with files, you would post this story as AC IMHO
Poor guys got nearly executed by community.
There can't be any security problem on OSX! Its not Windows man! How much did BillG paid you to post it?!!
Or or... VA Linux conspiracy?
It occurs to me that this problem could be broader than is being portrayed.
Consider: the fundamental issue here is that an OSX web browser -- Safari in the original reports, but apparently also Mozilla etc -- is acting as a broker for any URI that the user may come across, delegating the request out to external handler programs. Whether those external programs handle their URIs safely may be an open question.
The problem isn't really that Safari or Help is broken, but that the interaction between them, arising from the URI handling mechanism on OSX, is leading to Unintended Consequences.
OSX can handle many different URI namespaces, some of which seem to be used nowhere other than OSX. I'm having a hard time finding an exhaustive list of the URI protocols that OSX supports, but a partial list includes, in no particular order:
So far, I can think of published vulnerabilities in the telnet:// and now help:// protocols, but is that the end of it, or is the whole framework vulnerable to these sorts of attacks?
I have a hunch that we're just seeing the thin edge of the wedge...
DO NOT LEAVE IT IS NOT REAL
This doesn't work at all on my machine... After Help Viewer opens, I get a dialog saying: "The item cannot be opened. It may be disabled or not installed." Yes Safari automounts DMG's and no I havent changed anything in Internet Config.
I think it's too facile to say that running your web browser in an untrusted box is an adequate answer. There are all sorts of reasons why it's not. Just for starters, it's horrible from the user experience perspective. Yeah, fast user switching is neato, but it's not meant to be a way to switch between apps which is effectively what you're proposing. Using it that way moves the user experience all the way back to the days of Andy Hertzfeld's Switcher, before System 6 introduced Multifinder.
You're right in your second paragraph though -- Apple does need to fix this. Until they do, I'd prefer to use the hack of moving/deleting/retargeting/changing permissions on the Help app rather than reverting to a 1986 UI.
By the way, do you run Safari in its own untrusted account?
(I don't even want to get into the discussion of how the logical conclusion of the approach you're espousing would be a separate, untrusted account for every single app you run.)
I say it's patched in less then 14 days. Maybe 7 if it's an easy fix.
Just one more reason for Apple to rethink the whole 'Help Viewer' implementation. I don't know about you, but I despise that sluggish POS (I hate that spinning beachball). I do not even bother using it. It is faster to find 'help' via a google search. It is without question the LAMEST aspect of OS X.
I hate to say this, but another alternative is to use IE5 (yuck) for the Mac.
Go into user preferences.
Expand the "Network" hierarchical menu item (by clicking its disclosure triangle).
Select the "Protocol Helpers" menu item.
Now change the "Protocol Helper Settings" for the help protocol to something innocuous like "TextEdit".
This defeats the sample exploit ("TextEdit" is open but nothing is executed).
I hope this will make Apple consider adding a "Protocol Helper" option in Safari preferences.
...this bug fix will be targeted for 10.3.4?! From posts here and abroad, sounds like this is a 10.3 only issue. Remember Apple is doing no further development of Safari for the 10.2 platform. (Still miffed about this...)
For a demonstration, see this thread on MacCentral.
Since, according to Insecure.ws, Apple was notified of this back in February, it's fairly scandalous to be waiting for a solution in May.
From what I've seen, it doesn't appear possible to include spaces in the direct commands to the terminal, which would seem to make this exploit somewhat limited in terms of its effectiveness. (i.e., a command like "help:runscript=MacHelp.help/Contents/Resources/En glish.lproj/shrd/OpnApp.scpt string=usr:bin:top" will work, but something like "help:runscript=MacHelp.help/Contents/Resources/En glish.lproj/shrd/OpnApp.scpt string=rm -R /*" won't) Is this correct, or has someone found a way around that? Also, if the user browsing is logged in to a non-admin account, wouldn't this necessarily limit the scope of the command? (not that it makes a lot of difference- most casual Mac users stay logged in as "admins" 100% of the time anyway, I'd imagine)
Not yet, but I will if exploits start appearing in the wild.
I have just successfully embedded the HTML into Apple Mail (using Mozilla's HTML mail editor) and sent myself a mail with a link which once clicked runs the code. Here is the HTML:
c es/English.lproj/shrd/OpnApp.scpt%20string=%27usr: bin:du%27">Click to go to your next message</a><br>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
<a
href="help:runscript=MacHelp.help/Contents/Resour
</body>
</html>
It will display 'Click to go to your next message' and run the code (without visiting a web page).
The problem is a general flaw in not only URI handling but protocol registration. To see what I mean, you can read this thread at MacNN where it was fully uncovered:
http://forums.macnn.com/showthread.php ?s=&threadid =213043&perpage=50&pagenumber=1
A small group of posters quickly discovered that there is a way to automatically register an arbitrary protocol for an application. The protocol can then be used to launch the app via an OSX browser.
http://forums.macnn.com/showthread.php?s=&thread id =213043&perpage=50&pagenumber=6#post199571 0
Combine this with disk: mounting of images on a server, or autoexpanding archives, Meta refresh tags, etc., and by simply viewing a webpage malware can be launched.
Slashdot has totally missed the story here.
Here's the summary from the MacNN thread by theolein on the work done by smeger, Charles S, and Developer. People need to flood Apple with emails about this, product-security@apple.com
***************
quote:Originally posted by biscuit:
So, lemme get this straight in my head,
* A disk image can be remotely mounted with a click via the use of disk://, or d'loaded and mounted via Safari's "Open 'Safe' files..." pref
* Said disk image can be opened without user-intervention via the use of file://
* The disk image can contain an app that handles a new URL scheme, e.g. evil://
* LaunchServices will, without notification or intervention, register said URL scheme
* A refresh-tag in a web-site can call the new URL scheme without user-intervention, thus launching the app on the DMG. This app is now free to wreak havoc.
* OR the nasty app can just pretend to be one of the non-installed programs found in IC and achieve the same result.
So, Paranoid Android will save us from the new URL schemes, but what about the ones that are assigned to non-installed apps? Change them all to Chess with More Internet? And even with PA installed, I take it we still have to keep help:// away from Help Viewer.app? And probably disk:// should point to Chess too, right?
Maybe there's a reason Apple didn't respond quickly to the original exploit i.e., they found this mess themselves and are trying to find an elegant (and robust) solution?
biscuit
I think it's a bit more complicated than that. As I see at the moment:
The original problem had three parts:
* The help:// protocol could be used to launch any Applescript anywhere on the disk. (Such as the OpnApp.scpt that is all over the disk)
* The disk:// protocol could be used to force a browser to remotely, without downloading, mount a disk image, thereby giving the above problem a known path to launch an applictaion on the disk image.
* Via meta refresh tags or Javascript, the process could be done transparently in the background without the user having to click on a link. The simple visiting of a mailcious webpage would be enough.
However, the problem then got worse in that CharlesS, Developer and Smeger amongst others discovered that the actual problem is deeper than that:
* Apple LaunchServices, the API that sets which protocol helpers are bound to which applications will automatically add a new protocol helper for any application that has the relevant information in it's Info.plist etc. This means that if one browses a mounted disk image with said malicious application, a webpage that uses the new protocol added by that application will automatically launch that application.
* Apple LaunchServices will also, as Developer has noted, automatically add a new protocol and helper for the same application as mentioned above if a network share is mounted. This has consequences, I think, for schools, companies and universities, that rountinely have mounted public shares and lots of untrusted/unknowing users.
* If the "Open 'safe' files after downloadin