Blog Post Image

We ran the Black Hat CSS attacks against bmail. None of them worked.

Gmail, Outlook, Yahoo, AOL, Fastmail, and Proton Mail all fell to styling code hidden in an email. Here's what each attack does and what stops it on bmail.

Published on August 10, 2026

Themes:PortSwiggerCSSemailGmailOutlookYahooAOLFastmailProtonmail

  • At Black Hat USA on August 6, PortSwigger's Gareth Heyes demonstrated attack chains that use only CSS and HTML to spoof login screens, steal passwords and session tokens, and track email opens across Gmail, Outlook, Yahoo, AOL, Fastmail, and Proton Mail.
  • We ran every technique in the paper against bmail using the public proof-of-concept code. None of them worked, because bmail discards anything outside a strict allow list before rendering and blocks remote images until you ask, then fetches them through an SGX enclave so the sender never sees your IP.
  • Users have no lever here. You can't turn CSS off, ad blockers and script blockers don't touch it, and every real mitigation sits with the provider.

The styling language that picks the fonts and colors in your email is enough, on its own, to steal your password. No JavaScript. No attachment. Just CSS.

That's the finding PortSwigger researcher Gareth Heyes presented at Black Hat USA 2026 on August 6, in a paper called CSS: the bomb inside your inbox. It documents working attack chains against Gmail, Outlook, Yahoo Mail, AOL Mail, Fastmail, and Proton Mail.

Heyes did not test bmail. So we did it ourselves. We pulled the public proof-of-concept code and ran every technique in the paper against our own client. None of them worked. Below is what each attack does, and what stops it on our side. The PoCs are public, so you don't have to take our word for any of this.

What Heyes found

Webmail renders untrusted content inside a trusted interface. Your inbox app and the message you're reading share the same page. Every provider tries to make that safe by sanitizing the incoming HTML and CSS, stripping anything dangerous while still letting a newsletter look like a newsletter.

Heyes attacked that from two directions: abuse the CSS features webmail already allows, or find the gap between what the sanitizer thinks it approved and what the browser actually builds. Either one lets content inside a message reach out and touch the interface around it. As The Hacker News reported, the chains can capture passwords, take over third-party accounts, leak tokens, hijack trusted UI actions, and manipulate AI tools that read email.

The Outlook chain is the one that should worry people. Allowed label elements trigger controls outside the message, sanitized custom attributes get turned into new DOM nodes by the app's own JavaScript, and a media-query parsing trick hands the attacker arbitrary CSS. The payload disguises a select element as a password field and paints a convincing Microsoft sign-in screen over the top of your inbox. In Firefox, the option-selection timer resets when the select moves offscreen, which makes the capture happen in real time as you type.

Yahoo Mail and AOL Mail fall to a different route. In Firefox, pasted HTML briefly keeps its CSS active before sanitization catches it. In the demo, the attacker starts an email-login flow on Medium, the victim copies attacker-supplied CSS, and pasting it into a draft leaks enough of the 12-character login token for the attacker's server to reconstruct it and sign in.

There's a click-based exfiltration technique for when Content Security Policy blocks external resources entirely. CSS works out which digits appear in a token rendered as text, hides the non-matching links, and leaves the matching one spread across the page. One click from the victim sends the digits home.

Then the tracking bugs. A Fastmail image-proxy bypass using an escaped backslash and an allow-listed user.fm domain reveals when a message is opened. Gmail's image-set() fallback makes an external request despite sanitization. And a separate vector exposed the recipient's IP address in Proton Mail, whose tracker protection documentation, says the service is designed to hide exactly that, along with your exact email-open time.

Finally, the AI chains. Heyes and PortSwigger colleague Pete Hendy chained the Gmail image-set() bypass to an indirect prompt injection processed by an AI assistant with a connected Gmail account, which retrieved a Slack token and placed it in a draft where viewing it leaked the token. A Fastmail demo used pseudo-elements and opacity so a human saw harmless text while the model read hidden instructions.

Not everything is still live. Fastmail patched two CSS mutation bugs, but Outlook's label-jacking and Gmail's image-set() bypass both still worked on August 6, and the paper doesn't say whether the full Outlook password-capture chain has been fixed.

What happened when we ran it against bmail.ag

Fake login overlays never render. The HTML elements and positioning tricks that chain depends on aren't on our allow list, so email content can't paint anything over the bmail interface.

Token and session theft through CSS gets nowhere, because email styling can't reach or read anything outside its own message.

Hidden tracking is off by default. Remote images don't load until you ask for them. When you do ask, the request goes out through our API gateway, which runs inside an Intel SGX enclave and fetches the image on your behalf with a generic User-Agent. The sender sees bmail's IP address, not yours. 

The image-set(), @import, and url() exfiltration tricks that beat Gmail and others didn't fire. We remove the CSS features those techniques need to make an outside request.

The AI prompt-injection chains don't apply. bmail doesn't feed your inbox to an AI assistant, so there's nothing in our product for an attacker to hijack. If you connect a third-party AI tool to any mailbox, including this one, that tool becomes part of your attack surface. Heyes' research is the clearest argument yet for thinking hard before you do it.

Why the results came out this way

bmail treats every incoming message as hostile. We use a strict allow list, not a block list. Only known-safe formatting survives, and everything else is discarded before it ever reaches the renderer. Block lists fail the moment a browser ships a new CSS feature nobody thought to add to the list, which is precisely the failure mode Heyes is describing. He told Dark Reading that CSS is almost a programming language now, and that every new feature browsers add grows the attack surface.

The other half is remote content. Our default is that nothing in a message talks to the outside world without your say-so, and when you say so, the enclave gateway does the talking.

What we're not claiming

Heyes is right that browsers keep adding features and the surface keeps growing, and anyone who tells you their email client is permanently immune to a field this young is guessing.

What we will say is that the architecture is built for this. A strict allow list degrades safely when something new arrives, because unknown means discarded. And the code that fetches your remote images runs in an attested enclave whose measurement you can check yourself, rather than in a server we're asking you to trust.

Heyes made one more point worth sitting on. Users have no agency here. You can't turn CSS off. Ad blockers don't touch it, script blockers don't touch it, and the only real mitigations live with the provider. Which means the only question that matters is what your provider built.

Try bmail at bmail.ag.

Your privacy is worth protecting.

Get vp.net™ - the only VPN that isn't spying on you