FastMail.FM Security Vulnerabilities
FastMail's webmail let JavaScript inside SVG attachments run when a user clicked View, and attachment filenames were inserted into the page without escaping, so a crafted email could run script as soon as it was opened. An attacker could then act as the victim in their browser and, before HttpOnly was added, steal the session cookie.
grepular.com
Published on grepular.com
FastMail.FM is an email service established in 1999 and purchased by Opera Software in 2010. I recently discovered a couple of critical security vulnerabilities in their webmail offering.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the site treated any image content type as safe to display on its own domain, and it built the attachment list from unescaped file names.
Impact
Script running under the mail domain could read the user's email, send mail as them and change settings, and before HttpOnly was added it could steal the session cookie; the SVG flaw needed the victim to click View, while the filename flaw ran on opening the email.
What the attacker needed
Victim opens the email; victim clicks View on the attachment (SVG flaw); attacker can send mail to the victim
The fix
SVG was added to the download-only list, the content-type filter was corrected to stop the octet-stream bypass, filenames were escaped, and HttpOnly was added to cookies; the text says these were fixed.
How it was found
- Send an email carrying an SVG attachment that contains script.
- Open the email and click View next to the attachment.
- The SVG opens in a new tab under the mail domain and its script runs.
- For the second flaw, attach a file whose name contains script and open the email.
- The script runs as soon as the message is displayed.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
Webmail shows attachments in the browser under the mail site's own address. Some file types, like SVG pictures, can carry JavaScript, so opening one can run code as if the mail site itself had written it. Separately, the list of attachment names was placed into the page without cleaning, so a file name containing code ran the moment the email was opened.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.