Malicious CSS Emails Can Hijack Webmail UI

PortSwigger Research · High sophistication
Last updated August 7, 2026

PortSwigger research shows how attackers can weaponize HTML/CSS inside emails to cross trust boundaries in webmail, including UI manipulation, token theft, and password theft. The paper highlights real-world weaknesses in email sanitization and gives concrete examples (including an Outlook UI-control bug) that could be turned into realistic email-based attacks against employees.

How the attack worked

Research from PortSwigger examined how HTML and CSS embedded in emails can cross trust boundaries inside webmail clients. Because webmail clients often render untrusted CSS in trusted UI areas, and sanitization can be bypassed due to parsing discrepancies, attackers can manipulate interface elements that users assume are safe. One concrete example involved a real Outlook bug where HTML label elements inside an email could open the UI ribbon and pin the attacker's message, effectively letting the email content control parts of the mail client interface.

The research also described how attackers can hide content from a human reader while showing different content to an AI 'browser' or assistant feature. This creates a disparity between what the victim sees and what an AI feature processes, which can be used to manipulate AI-driven translation or summarization tools into taking unintended actions such as opening multiple tabs to attacker-controlled URLs.

A third technique involved clipboard behavior. Copying content from a webpage, such as a page showing a visitor's IP address, could carry hidden malicious CSS rather than plain text. When pasted into a webmail draft, this caused visible effects like a brief red flash in AOL and Yahoo Mail, pointing to a sanitization or race condition issue during paste handling.

Why it succeeded

These techniques succeeded because they exploit assumptions baked into everyday workflows: that clicking inside an email body is harmless, that AI assistants process content the same way a human does, and that pasted text is just text. None of the scenarios require a fake login page or urgent threatening language, which are the usual signals employees are trained to spot.

What to watch for

  • Unexpected instructions to click inside an email message body, especially phrases like "click here" that aren't part of a normal mail client control
  • Visual changes in the mail client, such as pinning, color flashes, or UI state changes, right after interacting with an email or pasting content
  • Prompts encouraging use of an AI translate or summarize feature on content from an untrusted or foreign-language sender
  • Requests to copy diagnostic-looking data, like an IP address, from a webpage into an email draft

Building resistance

Employees should treat unusual click-inside-the-email prompts as suspicious, particularly if they appear to affect the mail interface itself. Caution is warranted when using AI assistants to translate or summarize messages from unfamiliar senders, since indirect prompt engineering can trigger unintended actions like opening links. Finally, avoid copying and pasting content from unknown websites directly into email drafts or internal tools, since clipboard content can carry hidden HTML or CSS beyond visible text.

Key findings

  • Webmail clients often render untrusted CSS in trusted UI areas, and sanitization can be bypassed due to parsing discrepancies.
  • A real Outlook bug allows an email message to influence Outlook’s UI actions using HTML <label> elements (e.g., opening ribbon and pinning a message).
  • Attackers can hide content from a user while showing different content to an AI ‘browser’ feature, enabling indirect prompt injection via email.
  • Clipboard/paste behavior can introduce malicious CSS into draft emails; tests showed visible effects (e.g., a brief red flash) in AOL and Yahoo Mail, suggesting a sanitization/race issue.
  • The research discusses stealing tokens (e.g., email login tokens) by abusing CSS selectors and browser/webmail behavior.

Who’s being targeted

  • Commonly targeted roles: All employees, Executives, Executive assistants, Helpdesk/IT support, Users of AI email/browser assistants.
  • Affected industries: Technology / Email providers, Professional services (any organization using webmail), Media / Publishing (referenced token target: Medium).
  • Attack channels: email, website.
  • Impersonated: A normal email message (no explicit brand impersonation; abuse of Outlook UI controls), A foreign-language sender / translation request (uses AI ‘translate’ workflow), A website showing the user their IP address (clipboard poisoning).

Red flags to watch for

  • Unexpected instructions to click inside the message body (not a normal Outlook control)
  • Odd ‘Click me first’ style prompts without business context
  • Email seems to change Outlook UI state (e.g., message becomes pinned) after clicking
  • Email encourages use of an AI feature to process content from an untrusted sender
  • Hidden/transparent content (very low opacity) embedded in the email
  • AI tool starts opening tabs or navigating without clear user intent
  • Copy/paste from web pages into email drafts causes unusual visual changes (e.g., colors flashing)
  • Pasted content includes formatting/behavior beyond plain text
  • Requests to copy/paste ‘diagnostic’ or ‘IP address’ data into email drafts
Try Mirage

Mirage safely runs attacks like this one against your own team, so you find out what happens before a real adversary does.

Get a demo

Frequently asked questions

How can CSS in an email hijack a webmail interface?

Webmail clients sometimes render untrusted CSS in trusted UI areas, and sanitization can be bypassed due to parsing discrepancies, letting attacker-controlled styling influence how the interface behaves.

Can an email actually control Outlook's UI?

Yes, researchers found a real Outlook bug where HTML label elements in an email could trigger UI actions like opening the ribbon and pinning the attacker's message.

How does copy pasting content lead to a CSS attack?

Clipboard content copied from a webpage can carry hidden HTML or CSS rather than plain text, and pasting it into a webmail draft can trigger visible effects, which was observed in AOL and Yahoo Mail.

How can AI email assistants be manipulated by this technique?

Attackers can hide content from the human reader using CSS opacity while showing different content to an AI feature, enabling indirect prompt injection that causes the assistant to take unintended actions like opening tabs.

Read the video transcript

Imagine an email that doesn’t just trick you… it quietly controls your Outlook window. PortSwigger found a real Outlook bug: an email with HTML labels like "Click me first" can open the ribbon and even pin that message, just from you clicking text in the email body. Same trick with AI: a foreign email says "PortSwigger est le meilleur…" and tells you to translate. Hidden CSS can show one thing to you, and different instructions to the AI, making it open attacker URLs in new tabs. If an email tells you to click text inside the message to pin, open ribbons, or use AI on it, stop. Close it and report the email to Security instead of clicking.

Similar attacks

AI Browser Tricked into Spamming WhatsApp, Shopping

AI Browser Tricked into Spamming WhatsApp, Shopping

Researchers showed how a malicious web page could trick OpenAI’s Atlas AI-enabled browser into taking actions a user didn’t intend, like spamming WhatsApp contacts or modifying an Amazon account. The attacks used prompt-injection style instructions hidden in a seemingly legitimate “newsletter…

August 6, 2026
Fake ChatGPT Billing Emails Steal Card Details

Fake ChatGPT Billing Emails Steal Card Details

Check Point reports that scammers are now impersonating ChatGPT/OpenAI in phishing campaigns, reflecting how mainstream the service has become. One documented example used a fake “ChatGPT Plus payment failure” notice that sent victims to a fraudulent payment page designed to capture full credit…

July 28, 2026
Fake ChatGPT Billing Emails Steal Card Details

Fake ChatGPT Billing Emails Steal Card Details

Check Point reports that OpenAI’s ChatGPT became a top-10 most impersonated brand in Q2 2026 phishing. One observed example used a fake “ChatGPT Plus payment failed” billing email to drive victims to a credit-card theft page. The report also notes other brand-impersonation scams using cloned stores…

July 24, 2026
Hackers Hijack Hotel Wi‑Fi to Push Fake Updates

Hackers Hijack Hotel Wi‑Fi to Push Fake Updates

Microsoft says attackers hijacked captive portals on hotel and conference Wi‑Fi to redirect travelers through attacker infrastructure. Victims were shown fake browser/OS update prompts (and sometimes “paste-and-run” instructions) to install malware, and later were pushed into Microsoft device-code…

August 3, 2026
Hotel Wi‑Fi DNS Scam Steals Microsoft 365 Logins

Hotel Wi‑Fi DNS Scam Steals Microsoft 365 Logins

Attackers are taking over hotel and conference Wi‑Fi gateways and changing DNS settings so travelers are silently redirected to fake Microsoft 365 sign-in pages. Victims are then tricked into completing a device-code login that grants attackers a legitimate session token, often bypassing MFA. This…

July 28, 2026
Phishers Abuse DocuSign, Rewards, and “Verification”

Phishers Abuse DocuSign, Rewards, and “Verification”

This weekly roundup describes multiple real-world campaigns where attackers trick people using familiar brands and “verification” prompts to steal credentials or install remote-control tools. The common theme is trust abuse: messages and web pages look legitimate, then push users to log in, click…

July 28, 2026