At FastMail, we're always looking to increase security for our users. Cross-site scripting (XSS) attacks are one of the dangers that all websites must take care to mitigate against. HTML email is the highest risk for all webmail providers. Before embedding it into a page, it must be carefully checked and any potentially malicious content removed. In particular, all scripting content must be removed otherwise an attacker could gain access to your account and email.
Due to the complex nature of HTML parsing and encoding, there are many ways that a malicious email might try to sneak through scripting content. That's why we fully parse the HTML first on the server and sanitise it against a white-list of known-good tags and attributes. This ensures that any scripting content is stripped, and other ambiguous content is properly escaped and encoded.
We're very careful, and we have lots of tests to ensure we protect against all known techniques for trying to embed scripts. However, there's always a possibility of bugs in any software, and Content Security Policy, also known as CSP, is a new HTTP header that provides an extra layer of defence against these types of attacks.
With CSP, we can instruct all modern browsers to only ever load scripts from our own website. Any references to remote scripts or "inline" scripts will be blocked. This means if a malicious email somehow slips through our filters, the browser still stops it from doing anything dangerous.
We've just rolled this out on our beta server
(https://beta.fastmail.fm) for testing. We hope to roll it out
everywhere soon. If you use our beta server, please let us know of any
new issues you notice by emailing firstname.lastname@example.org. Some
browsers may have issues with extensions. These should be allowed to run
according to the spec, but some browsers
may prevent them from doing so as a violation of the content security policy. If you have a problem with an extension at FastMail, please first try updating to the latest version. If the issue still persists, please let us know so we can contact the extension authors.