CybersecurityAugust 9, 2026· via Security Affairs

Stealthy CSS attacks can hijack webmail and AI inboxes

Stealthy CSS attacks can hijack webmail and AI inboxes

Image : Security Affairs

Webmail clients thought CSS was just for pretty colors—but a researcher just turned styling into a stealthy backdoor. Plain CSS, the language that makes emails look good, can now steal credentials, hijack sessions, and even manipulate AI tools that read your inbox.

How styling became a backdoor

Most webmail services render untrusted HTML and CSS inside a trusted interface, relying on sanitizers to block dangerous code. Gareth Heyes of PortSwigger showed how two simple tricks break that wall. Either abuse allowed CSS features or exploit mismatches between sanitizer rules and what browsers actually render. Either way, an attacker’s email can reach beyond its own message and interact with the surrounding UI.

Outlook’s hidden dropdown trap

The most alarming proof-of-concept targets Outlook. Allowed HTML label elements can trigger external controls, and Outlook’s own JavaScript can turn sanitized attributes into fresh DOM elements carrying CSS that bypass sanitizers. Heyes disguised a dropdown as a password field; because Firefox resets its one-second selection timer when the dropdown moves offscreen, the attack captures keystrokes in near real time.

Copy-paste leaks in Yahoo and AOL

Yahoo Mail and AOL Mail offered a different opening. In Firefox, pasted HTML briefly keeps active styling before sanitization kicks in. Heyes weaponized that gap to leak a 12-character login token during a Medium sign-in flow, enough for an attacker’s server to reconstruct the token and log in as the victim.

Why it matters

CSS was never designed for security, yet webmail clients treat it as harmless decoration. This research reveals how styling can be weaponized to defeat sanitizers, steal credentials, and subvert AI tools that depend on inbox data. The attack surface is broad—Outlook, Gmail, Fastmail, Proton Mail, Yahoo Mail, and AOL Mail all showed weaknesses—so providers must rethink how they isolate untrusted content from trusted interfaces.


Source: Security Affairs. AI-assisted editorial synthesis — TechnoExpress.

Read the original source on Security Affairs →

← Back to home