Skip to content
XSS Write-up Advanced

Code Vulnerabilities Put Skiff Emails at Risk

A mutation-based XSS vulnerability in Skiff's webmail allowed attackers to bypass HTML sanitisation and execute arbitrary JavaScript in the context of the application, potentially stealing decrypted emails and impersonating victims. The exploit required sending two emails and the victim clicking a link, but ultimately bypassed the end-to-end encryption.

Paul Gerste Follow

Published on sonarsource.com

Last week's article discussed the risks of end-to-end encrypted mail providers and showcased the details of a Cross-Site Scripting vulnerability we found in Proton Mail.

Paul Gerste, on sonarsource.com

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

The application modified the sanitised HTML by inserting a <div> element inside an <svg> element, which is invalid and caused the browser to re-parse and mutate the HTML, leading to an mXSS bypass.

What the attacker needed

Victim views two emails; victim clicks a link; attacker can send emails to victim

The fix

The Skiff team fixed the vulnerability by moving the sanitizer pass after all modifications to ensure the final HTML is safe.

How it was found

  1. Attacker sends an email with an attachment that causes a blob URL to be created and includes CSS that leaks the blob URL to the attacker.
  2. Attacker sends a follow-up email containing a link to the leaked blob URL.
  3. Victim clicks the link, opening the blob URL in a new tab.
  4. The blob URL contains a payload that bypasses the CSP using a Cloudflare/hCaptcha gadget and executes arbitrary JavaScript.

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.

Skiff is an email service that encrypts messages so only the sender and receiver can read them. However, a coding mistake in how Skiff displayed emails allowed an attacker to sneak malicious code into an email that, when opened, could run in the victim's browser and steal the decrypted content. This shows that even with strong encryption, bugs in the app can still expose data.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

More by Paul Gerste

View all

7 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.