<p><strong>News Date: 2026-08-08</strong></p><p>HTML email has always created tension between presentation and security. New research demonstrates that Cascading Style Sheets can do far more than format a message when webmail applications fail to maintain a strict boundary between untrusted email content and their own interface.</p><h2>When Styling Escapes the Message</h2><p>PortSwigger researcher Gareth Heyes presented several attack chains involving major webmail platforms. The techniques either abused HTML and CSS features already permitted by a service or exploited differences between what a sanitizer approved and what the browser eventually rendered.</p><p>One Outlook and Firefox demonstration created a convincing Microsoft sign-in interface capable of capturing a password entered by the recipient. Other research showed how a brief sanitization race involving pasted content in Yahoo Mail and AOL Mail could help disclose an email authentication token. CSS could also manipulate links, redirect user interactions or trigger external requests that reveal information.</p><p>The research additionally examined risks created when email is connected to artificial intelligence tools. In one proof of concept, indirect instructions inside Gmail content influenced an AI assistant and contributed to the exposure of a Slack confirmation token. Another demonstration used styling to present harmless text to a person while an AI browser interpreted hidden instructions.</p><p>No malicious exploitation was reported, and several demonstrations required user interaction or specific browser behavior. Some affected techniques have been corrected, while the publication indicated that others were still working when the underlying research was released.</p><h2>Defensive Priorities</h2><ul><li>Render untrusted email content inside strongly isolated, sandboxed frames.</li><li>Apply strict allow lists to CSS properties, selectors and attributes.</li><li>Block message content from manipulating controls outside the email body.</li><li>Restrict attacker-controlled image requests and carefully audit trusted proxy domains.</li><li>Treat email supplied to AI assistants as untrusted instructions rather than ordinary data.</li></ul><p>I believe the most important lesson is that sanitization cannot be treated as a simple removal exercise. Security testing must evaluate the final browser document after application scripts, browser parsing and dynamic interface behavior have transformed it. In my view, AI integrations make this problem more urgent because a message now has two audiences: the employee reading it and the software agent interpreting it. Webmail providers must protect both audiences with isolation controls designed for hostile content.</p>