Re: Another Safari beta hole
Date: August 01, 2007 03:59PM
Hi Gareth,
The point is that you can't get it to run automatically, because a downloaded HTML file will not open automatically. If you can get it to run automatically, then yes, that would be an exploit, but we'd consider the automatic running itself to be an exploit, since presumably you could use such a mechanism to open a freshly downloaded application, or a word document with macros, etc etc.
Note that while Firefox doesn't allow local read access to remote resources, it does allow URI dereference and POST access (via form posting or subframes), and it allows read access to local file resources, so it can upload your local files.
I don't think allowing local HTML files to upload arbitrary local files to an arbitrary server, but preventing them from reading remote cookies or remote authenticated data, would make local HTML files safe to open. I would say we are not drastically out of line with other browsers on the local file security model. We are considering going further than Firefox to warning any time a local file tries to execute a script, like IE does. But I do not think the current behavior is a security hole.
I'm also not sure what the point is of your elaborate "mail this file" exploit. If you send HTML email, mail clients won't run the scripts. If it is sent as an attachment, then it is no worse than an attached executable, script or Word document, so long as Mail clients are aware that it's not safe content (which they should be, since in other non-Safari browsers they can upload your local files). I don't know of any way to get a mail client to automatically run script in an HTML file.
In any case, while this is an area that could possibly be improved for better trojan defense, I think it is inaccurate to portray this as a major hole (there's no drive-by exploit, you have to get the user to open a local file) or Safari-specific (in other browsers, local files can do equally bad things, though maybe not the exact same things).
Regards,
Maciej