Skip to main content

New CSS Attacks Break Webmail Interfaces to Steal Credentials

3 min read Runtime Rebel Intel
Primary source: thehackernews.com

This article was written by a language model from the source above and was not reviewed by a human before publication. Verify anything operational against the original. Editorial policy

Key points
  • New research demonstrates how malicious email content can escape boundaries to manipulate webmail interfaces and capture sensitive data.
  • Major webmail providers including Outlook, Gmail, Yahoo Mail, AOL Mail, Fastmail, and Proton Mail are affected.
  • Defenders must isolate HTML email within sandboxed iframes and restrict CSS, custom attributes, and image requests.

Advertisement

Overview of CSS Webmail Attack Vectors

New research presented at Black Hat USA 2026 by PortSwigger researcher Gareth Heyes demonstrates how malicious content inside an email can escape message boundaries and interfere with trusted webmail interfaces. According to The Hacker News, attack chains spanning Outlook, Gmail, Fastmail, Proton Mail, Yahoo Mail, and AOL Mail can capture passwords, hijack trusted user interface actions, leak authentication tokens, and manipulate AI tools that process email.

The research outlines two primary exploitation paths: abusing HTML and CSS elements already permitted by webmail filters, or exploiting discrepancies between what an email sanitizer approves and what the browser ultimately renders. Public proof-of-concept exploits remain available, though several vendors have begun addressing individual components of the research.

Technical Analysis of Interface Breakouts

The techniques bypass traditional filtering mechanisms by exploiting how webmail clients render user-supplied HTML and CSS alongside trusted application components.

Outlook and Firefox Credential Capture

An Outlook and Firefox attack chain combines allowed label elements with application JavaScript to generate custom attributes outside sanitizer restrictions. A media-query parsing trick grants attackers arbitrary cascading style sheets. The resulting payload disguises a select element as a password field, while browser behavior resets option-selection timers when the element moves offscreen, enabling real-time password capture.

Yahoo and AOL Paste Race Token Theft

Yahoo Mail and AOL Mail exposed a distinct vector involving paste race conditions in Firefox. Pasted HTML briefly retains active cascading style sheets prior to sanitization. In a demonstrated attack against Medium, a victim copies attacker-supplied styles to the clipboard and pastes them into a draft. Resulting HTTP requests reveal fragments of a 12-character login token, allowing an attacker’s server to reconstruct the credential.

AI Assistant Manipulation and Exfiltration

Connected AI tools introduce additional risk vectors:

  • Gmail and Anthropic Claude: An image-set fallback triggers external requests despite sanitization. Chained with indirect prompt injection, an AI assistant processes the email, retrieves a connected Slack token, and places it in an HTML draft for exfiltration.
  • Fastmail and OpenAI Atlas: Cascading style sheets pseudo-elements and opacity obscure hidden prompts from human users while exposing them to the AI model, prompting unauthorized browser actions.

Mitigation and Defense Strategies

Defenders and email service providers must implement strict boundary controls to neutralize interface-breaking techniques. Essential hardening measures include:

  • Sandboxed Rendering: Isolate all incoming HTML email messages within heavily restricted, sandboxed iframes to prevent DOM manipulation outside the message boundary.
  • Strict CSS Validation: Enforce character allow lists for cascading style sheets, restrict dangerous selectors, and block unauthorized image requests.
  • Sanitizer Alignment: Ensure sanitization engines thoroughly evaluate custom attributes and CSS gadgets before rendering DOM nodes.

Related: Emerging Cyber Threats and Espionage Risks in Neurotechnology, Keyv npm Supply-Chain Attack: Worm Infection and Dead-Man Switch

Advertisement

Advertisement