Does anyone else find it rather insane that SVG allows bundling code? "Active" documents like PDF and Office have demonstrated the problems associated. Why does a vector graphic format need scripts?
When you consider SVG can be seen as an potential alternative to Flash for some projects, it is not hard to understand why manipulation through scripting is a desired feature.
So instead of creating a vector format that can be safely used and manipulated from a containing environment (like any other "dumb" image format), they wanted to go make a whole new rich document system? Sigh.
Using a separate domain to display the attachments is a good idea. Gmail does it. It is mentioned towards the end of the blog post. However, that still doesn't get rid of the vulnerability, it just makes it less dangerous.
There should be a strict whitelist of allowed content types, and anything not on that list should be download only. The trouble is, people tend to put "image/*" on that list, because they don't know what an SVG is or what it can do.
Nice work, and (as another fastmail.fm user) thank you for the responsible disclosure. May it amply repay you in consulting gigs :)
Regarding the script injection from image file names, there is a simple solution to this problem: separate the data types of strings and document structure. For example:
If the JavaScript executed, it's a "probable" critical security flaw, rather than a "possible" one. Are they using the latest version? Would you be able to submit a bug report to your provider and/or the Horde project?
Thanks. I am currently discussing the problem with Jan Schneider (the core developer and a founding member of Horde LLC) in the #horde IRC channel on Freenode.
[edit] They've confirmed the bug and intend to fix it by making "image/svg+xml" attachments download only. This is the same fix that FastMail used. Of course, everyone will need to upgrade when this has been done.
Thanks for the report. I have just sent a bug report to their security address about this.
It would probably be better if people submitted these bugs directly to the vendor rather than making them immediately public. If you don't know how to do this, or how to describe the bug, you can let me know and I will do it on your behalf. My contact details are in my HN profile