Particle.news

PortSwigger Shows How CSS in Emails Can Break Webmail Boundaries and Steal Tokens

The research matters because simple styling can be used to trick webmail interfaces and connected AI tools, creating new paths for credential and token theft.

Overview

  • PortSwigger researcher Gareth Heyes published proof‑of‑concept code and a detailed paper in early August showing that allowed HTML and CSS inside emails can escape their message window and interact with the surrounding webmail UI.
  • The attacks exploit two core flaws: sanitizer/browser mismatches that let permitted styles affect the main page and browser quirks that change control timing, for example disguising a select menu as a password field to capture keystrokes in Firefox.
  • Researchers demonstrated multiple practical chains that steal passwords, leak login tokens, hijack clicks, and take over sessions using techniques such as a paste‑race that exposes a 12‑character login token and a click‑based CSS exfiltration method that works even when external resources are blocked.
  • Major providers were tested: Fastmail and Proton Mail fixed some reported bugs before publication, while Outlook label‑jacking and a Gmail image‑set() fallback used in an AI connector attack remained working when retested in early August.
  • PortSwigger urges webmail vendors to isolate HTML in sandboxed iframes, apply strict CSS allow‑lists, block attacker‑controlled image requests, scan for dangerous "CSS gadgets," and review AI connector behaviors to prevent automated tools from following hidden instructions.