New research shows how CSS-based attacks can escape email boundaries to hijack webmail interfaces, steal passwords, leak tokens, and even manipulate AI tools across major providers.
## The Invisible Threat Hiding in Your Inbox
You probably don't think twice about opening an email from a trusted sender. But what if the message itself could break out of its box and start messing with the webmail interface you're using? That's not science fiction—it's the reality of a new wave of CSS-based attacks that researchers just uncovered.
PortSwigger researcher Gareth Heyes found that content inside an email can actually escape its message boundary and interfere with the webmail app around it. Think of it like a letter that somehow crawls out of its envelope and starts rearranging the papers on your desk. That's the level of control these attacks can give a malicious sender.
The scariest part? The techniques work across nearly every major webmail provider, including Outlook, Gmail, Fastmail, Proton Mail, Yahoo Mail, and AOL Mail. So no matter which inbox you call home, you might be exposed.
### What These Attacks Can Actually Do
This isn't just about reading your emails. The attack chains are far more dangerous. Here's what a skilled attacker could pull off:
- **Capture passwords** as you type them into forms within the webmail interface
- **Take over third-party accounts** that you access through your email
- **Leak authentication tokens** that could grant persistent access to your accounts
- **Hijack trusted UI actions**, like clicking "Reply" or "Forward" and having it do something else entirely
- **Manipulate AI tools** that read your email, feeding them false information or stealing what they process
That last one is particularly nasty. As more email clients integrate AI assistants to summarize messages or draft replies, those tools become prime targets. An attacker could poison the data an AI reads, causing it to leak sensitive details or act on malicious instructions.
### Why CSS Is the Perfect Weapon
CSS might seem harmless—it's just styling, right? But that's exactly why it's so dangerous. Email providers have spent years locking down JavaScript and other scripting languages. But CSS is often allowed through with fewer restrictions because it's considered "safe." Attackers are now exploiting that trust.
By using clever CSS tricks like `:has()` selectors, invisible overlays, and attribute selectors, they can essentially create a hidden layer of interaction on top of the webmail interface. You think you're clicking a button in Gmail, but you're actually triggering something entirely different.
### Who Should Be Worried?
If you use webmail for personal communication, you're at risk. But the stakes are much higher for professionals who rely on email for work. Think about all the sensitive info that flows through your inbox: financial statements, client contracts, password resets, two-factor authentication codes.
A single compromised email session could give an attacker access to your bank, your social media, your cloud storage, and anything else tied to that email address. It's a domino effect that starts with a single malicious message.
### What You Can Do Right Now
While the researchers are working with providers to patch these vulnerabilities, there are steps you can take to protect yourself:
- **Use a dedicated email client** like Thunderbird or Outlook desktop instead of the web interface when possible
- **Keep your browser updated**—modern browsers are adding protections against some of these CSS tricks
- **Be wary of unexpected emails**, even from people you know, especially if they contain unusual formatting or prompts
- **Enable two-factor authentication** on your email account so a stolen password isn't enough
- **Consider an antidetect browser** if you manage multiple accounts; these tools can isolate sessions and reduce the risk of cross-account contamination
### The Bottom Line
Email has always been a weak link in security, and this research proves the problem is far from solved. The fact that something as simple as CSS can be weaponized to break webmail defenses is a wake-up call for the entire industry.
For now, stay alert, keep your software updated, and think twice before clicking anything inside an email. The message in your inbox might look innocent, but it could be trying to break out of its box and into your digital life.