Lead story
The Email That Escapes Its Own Envelope: CSS Attacks Can Break Webmail Across Gmail, Outlook, and More
Email has always operated on a simple promise: the message stays in the message box. New research from PortSwigger's Gareth Heyes shatters that assumption in spectacular fashion — and does it across six of the most widely used webmail platforms on the planet.
The attack class works by hiding CSS instructions inside an email's content. When a webmail client renders the message, those instructions don't just style the email — they bleed out of the message boundary and start interfering with the surrounding page. Think of it like a tenant who repaints not just their apartment but rewrites the building's wiring while they're at it.
What can attackers actually do with this? Quite a lot. The research demonstrates credential theft (captured passwords), session token leakage, account takeover via third-party OAuth flows, hijacking of trusted UI elements (buttons that appear to do one thing but do another), and manipulation of AI-powered tools that ingest and summarise email. That last one is particularly pointed timing given how rapidly AI assistants are being bolted onto inboxes.
The affected platforms confirmed in the research are Outlook, Gmail, Fastmail, Proton Mail, Yahoo Mail, and AOL Mail. That's not a niche list — between them those services cover the vast majority of webmail users globally, including a significant slice of Australian consumers and businesses. Proton Mail's inclusion is especially notable given its reputation for privacy-conscious users who might reasonably assume their provider applies more rigorous sandboxing.
Why is this hard to fix? CSS is legitimately used in HTML emails for formatting and layout, so providers can't simply strip it all without breaking a huge chunk of normal email. The challenge is correctly scoping CSS rules so they can't reach outside the message container — a problem that sounds simple but turns out to be genuinely fiddly to implement without regressions.
It's worth noting this sits in a long tradition of webmail sandbox escapes. The underlying issue — that rich HTML emails share a browser context with the hosting application — has never been fully solved, only iteratively patched. This research suggests the attack surface is broader than defenders previously mapped.
What should you do right now? For most users the fix has to come from the providers — this isn't something you can patch yourself. But organisations running email security gateways should check whether their vendors are aware of CSS-based exfiltration techniques and whether their solutions strip or sanitise malicious CSS before messages reach users. Security teams who rely on Proton Mail for sensitive communications should treat this as a prompt to review their webmail use policies while patches are confirmed.
PortSwigger hasn't published a full technical write-up yet, but given the breadth of affected services, expect patch timelines and vendor statements to trickle out over the coming week. The status of fixes across all six platforms is not yet fully confirmed — watch for vendor advisories.
This is the kind of research that will quietly get fixed and forgotten — but between now and full patching, every one of those six inboxes is a potential attack surface.
