Security

PortSwigger bypasses email protection – also AI assistants affected

3 min read

TL;DR Too Long; Didn’t read

PortSwigger researcher Gareth Heyes showed at Black Hat that six major webmail providers are vulnerable to pure CSS tricks. The attacks steal passwords and access tokens, or trick the AI mailbox assistant Cowork into hiding a stolen Slack token in an email draft. Fastmail has closed two reported bugs; Microsoft and Google have not fixed theirs, according to Heyes.

A torn-open envelope with a burning fuse made of CSS characters, next to a broken padlock and logo stickers of Outlook and Gmail Image generated with GPT Image 2

Key takeaways

  • Gareth Heyes from PortSwigger demonstrates CSS attacks against six webmail providers at Black Hat.
  • A CSS keylogger disguises itself in Outlook with Firefox as a regular password field.
  • At Yahoo and AOL, a clipboard race exposes a Medium login token.
  • The AI assistant Cowork forwards a Slack access token from a Gmail draft via prompt injection.
  • Fastmail closes two vulnerabilities and pays a $1,000 bounty for each.
  • Proton Mail initially dismissed a report and patched it months later.

The PortSwigger security researcher Gareth Heyes presented CSS attacks at the Black Hat conference in Las Vegas that compromise passwords, access tokens, and even an AI mailbox assistant – all without JavaScript. Six major webmail providers are affected: Outlook, Gmail, Fastmail, Proton Mail, Yahoo Mail, and AOL Mail. According to Heyes, central vulnerabilities remain open at Microsoft and Google.

CSS disguises keystrokes as a harmless dropdown menu

At the center of the presentation is an attack chain against Outlook in combination with the Firefox browser. Heyes uses an old CSS trick: a dropdown menu with adjacent options responds to a specific CSS selector, revealing which key was pressed last. Firefox resets an animation every 0.5 milliseconds, allowing keystrokes to be logged almost in real time. Through another CSS property, the field additionally disguises itself as a regular password field, so victims do not become suspicious. The chain begins with an email that bypasses the web interface’s sanitizer via CSS mutation: browsers convert hidden escape characters into regular CSS syntax when reading them back from the document model, allowing properties that are actually filtered out to leave the message window. In the end, the chain displays a fake Microsoft login screen that sends the entered password directly to a server controlled by the attackers. According to Heyes, this Outlook vulnerability still worked at the time of publication. The method is attractive for attackers because it combines only officially specified CSS properties and does not require a separately reportable software vulnerability – classic antivirus or spam filters barely catch it.

A paste race exposes access tokens at Yahoo, AOL, and Fastmail

A second chain concerns Yahoo Mail and AOL Mail and targets login tokens from the Medium platform. If an affected person pastes clipboard content into an email draft field, a brief time window opens in which embedded CSS runs despite filtering. Nested CSS attribute selectors check individual character strings of the twelve-character hex token from the start and end and reconstruct it from the overlaps – in the end, the attacking side can log in to Medium as the victim. At Fastmail, Heyes and his colleague Pete Hendy used a similar workaround via an image-proxy function to detect when an email was opened. Fastmail reportedly responded fastest, according to Heyes: the company closed two reported CSS mutation bugs and paid a $1,000 bounty for each finding. The technique can in principle be applied to any service that embeds login tokens directly in a callable web address, not just Medium – how many other platforms could be affected remains independently unverified.

AI mailbox assistant Cowork forwards a stolen Slack token

The chain Heyes considers most alarming targets Gmail in combination with Cowork, an AI-powered mailbox assistant with Gmail integration that searches emails and drafts replies. An email disguises a hidden instruction as a harmless CTF exercise and prompts Cowork to search the inbox for a confirmation code – in reality, the assistant grabs an access token for the messaging app Slack. The token ends up in a reply draft via an image address with a CSS fallback variable; once the user opens that draft, the browser loads the background image and sends the token unnoticed to a server controlled by the attackers. A security firm had already highlighted similar zero-click risks in several AI browsers. According to Heyes, Google rejected the underlying image-proxy bug; it still worked at the time of publication on August 6th. Proton Mail also initially dismissed a comparable report as not a bug, but quietly closed the flaw several months later without any public announcement.

Whether Microsoft and Google will close the remaining CSS vulnerabilities before a first real-world wave of attacks, or whether security teams will keep relying on user behavior such as clipboard pasting as an emergency brake, remains open. The case also points to a growing pattern: content that stays invisible to humans but gets read by AI assistants opens an additional attack path that classic phishing filters do not catch.

Frequently asked questions

Do I need to actively click something as a user for an attack to work?

It depends on the specific chain: in the Cowork example, opening an email draft is sufficient, while in the Outlook chain, an additional copy-paste step into a draft field is necessary.

Which software is specifically affected by the CSS attacks?

Mentioned are Outlook in combination with Firefox, Gmail, Fastmail, Proton Mail, Yahoo Mail, AOL Mail, as well as the AI mailbox assistant Cowork with Gmail integration.

Have the reported vulnerabilities been closed by now?

Fastmail has fixed two bugs and paid a bounty, while Proton Mail patched its case months later without announcement. According to Heyes, Outlook and Gmail were still working at the time of publication on August 6.

What can users do right now?

Those who avoid pasting unknown clipboard content into email drafts and connect AI mailbox assistants only with limited permissions significantly reduce the attack surface, although complete protection is only possible with manufacturer patches.

Where can the research be read in detail?

PortSwigger has published the complete research report along with example code and videos on its research page.

Sources (2)
  1. PortSwigger Research: CSS: the bomb inside your inbox
  2. The Hacker News: New CSS Attacks Can Break Webmail Defenses to Steal Passwords and Tokens

Your AI update for the work week

Once a week, the most important AI news – plus one practical tip to try right away. No spam, unsubscribe anytime.

← Back to the blog