Email CSS steals your password: the Black Hat 2026 research
At Black Hat USA 2026, PortSwigger’s Gareth Heyes presented research showing that CSS alone inside an email — with no JavaScript — can escape the message boundary and manipulate the webmail client’s interface. Chains were demonstrated against Outlook, Gmail, Fastmail, Proton Mail, Yahoo Mail and AOL Mail.
The result is not cosmetic defacement. These are demonstrated chains that steal typed passwords, take over third-party accounts and move tokens out.
Why CSS is an attack surface
Every webmail client allows some CSS in emails, because otherwise newsletters would look like text documents from 1995. Sanitization has traditionally focused on JavaScript and on dangerous tags.
The implicit premise is that styling is harmless: at worst, an ugly email. This research dismantles exactly that premise.
Modern CSS can select elements based on their state, trigger network requests through background images, and conditionally hide or reveal content. With enough care, those three capabilities combined produce a keylogger — without a line of JavaScript.
The demonstrated chains, by provider
Each chain depends on the combination of client and browser. This is not one vulnerability but the same idea applied to different implementations — which is why it worked almost everywhere.
- ▸Outlook with Firefox: label-jacking and custom attribute transformation produce a fake Microsoft sign-in screen that captures the typed password
- ▸Yahoo and AOL: a paste race exploits the brief window in which CSS is retained before sanitization, exposing an email-login token sufficient for account takeover
- ▸Gmail: an image-set() bypass, combined with indirect prompt injection, exfiltrates a Slack token when an AI assistant reads the email through the Gmail connector
- ▸Fastmail: CSS pseudo-elements and opacity tricks hide instructions from the human eye while leaving them readable to an AI browser
The core technique: label-jacking
In HTML, a label element can be bound to a control located elsewhere on the page. If the user clicks the label, the click lands on that control.
The attack uses that binding to redirect clicks onto elements of the mail client’s own interface, outside the message. The user believes they are pressing a button in the email; in reality they are operating something in the application.
The same family of tricks allows a select element to be disguised as a password field. Nothing the user sees contradicts their expectation, because everything they see is styling, and the styling is under the attacker’s control.
The new part: AI assistants that read your email
The most interesting shift from classic email attacks is that the victim no longer has to be a human.
CSS can hide text from the human eye while keeping it in the document — zero opacity, off-screen positioning, pseudo-elements. A person sees nothing. A model handed the page content reads all of it, including the instructions planted there for it.
That turns a mailbox into an input channel for indirect prompt injection. If the assistant also has access to other tools — a workspace connector, an integration token — the planted instruction can ask for those to be exfiltrated.
From a defensive standpoint, this is where the threat model changes: it is no longer enough for the interface to be safe for the human user.
What was fixed and what was not
Fastmail addressed two CSS mutation bugs. Proton Mail’s proxy bypass no longer worked on retest.
At the time the research was published, on 6 August 2026, Outlook label-jacking and Gmail’s image-set() bypass still worked.
No CVE numbers were assigned to these issues. They are defects in hosted services, fixable by the provider without you installing anything — good news for remediation, but it also means they appear in no vulnerability feed you could track.
What you can realistically do
- ▸You cannot fix your provider’s webmail client — but you can choose where you read email: native desktop clients do not carry the same attack surface as the web interface
- ▸Treat any sign-in screen that appears after a click inside an email as fake, however correct it looks; open the application separately, from a bookmark
- ▸Reduce reliance on passwords with FIDO2 keys or passkeys; for a captured password to stop being an access path, remove password fallback or enforce phishing-resistant MFA
- ▸Inventory which AI assistants have access to your organisation’s mailboxes and what other tools they are connected to — that is the chain that hurts
- ▸Review the integration tokens reachable from those assistants’ context; apply least privilege rather than convenience
- ▸Brief the team that an email can carry invisible instructions aimed at tools rather than people
What is not confirmed
There is no public evidence that these techniques have been used in real attacks. They are chains demonstrated by a researcher, with proofs of concept, not observed campaigns.
No figure for exposed users has been published, nor any remediation timeline from the providers that have not yet fixed their side.
The distinction is worth keeping: "works in a demo" is not the same as "being exploited now". But for published techniques with proofs of concept available, the distance between the two has historically been short.
How to monitor CVEs and get alerts for products in your inventory