HN Debrief

CSS: The bomb inside your inbox

  • Security
  • Privacy
  • Infrastructure
  • Web Development

PortSwigger’s post walks through attacks that use CSS, HTML quirks, and browser behavior to exfiltrate data from HTML email and interact with surrounding webmail UI without relying on JavaScript inside the message body. The targets named in the writeup include Gmail, Fastmail, ProtonMail, Slack, and Cowork. The core point is not just that HTML email is messy. It is that “CSS-only” content can still become active attacker-controlled logic once a webmail app renders it inside a larger trusted page.

If your product renders user-supplied HTML, email or otherwise, isolate it like hostile code rather than treating CSS as harmless formatting. For leaders choosing email infrastructure, plain text or native clients reduce this class of risk, while browser-based inboxes keep inheriting the web’s attack surface.

Discussion mood

Concerned and annoyed. Most commenters found the research believable at a high level and saw it as more evidence that HTML email is a security and privacy mess, with extra frustration directed at webmail vendors and at how hard it is to get fixes triaged.

Key insights

  1. 01

    Sandboxed iframes as the baseline

    Sandboxed iframes were framed as the default containment boundary for any untrusted message body, because they cut off the rendered email from the surrounding application instead of hoping sanitization catches every CSS and HTML trick. That sharpens the lesson from the research. The failure is architectural before it is a bad filter rule.

    If your app shows user-authored HTML anywhere near privileged UI, move isolation down into the rendering boundary. Review whether your current sanitizer is standing in for a sandbox you should have built instead.

      Attribution:
    • PoignardAzur #1
  2. 02

    Email clients are still a rendering backwater

    Email HTML remains stuck with table layouts and wildly inconsistent feature support across clients, even between desktop and mobile builds of the same product, as the Can I Email scoreboard shows. That matters here because broken and fragmented rendering rules create more weird corners for attackers and more exceptions for defenders.

    Treat HTML email support as legacy compatibility work, not as a solved browser problem. Budget extra testing and expect security fixes in one client or platform not to transfer cleanly to another.

      Attribution:
    • dabinat #1
  3. 03

    The hash exfiltration demo looks wrong

    The writeup’s example of sending stolen data via the URL fragment raised a real credibility issue, because the fragment is handled by the browser and normally never reaches the server. That does not erase the larger class of attacks, but it is a reminder to separate a valid attack surface from a shaky proof of concept.

    Read flashy security demos for mechanism, not just conclusion. If you are using this post to justify engineering work, validate the exact exploit path before scoping the fix or communicating impact.

      Attribution:
    • ksbd-pls-finish #1
  4. 04

    Bug triage is part of the security story

    Google’s contractor-heavy user issue triage was called out as a reason obvious security reports can stall before reaching the engineers who own the rendering model. That shifts some blame from any single bug to the reporting pipeline itself. A brittle inbox plus weak escalation is how “known weirdness” becomes long-lived exposure.

    If you run a platform with user-generated content, audit how security reports actually reach product engineers. A good sandbox on paper is not enough if the organization cannot recognize when it is failing.

      Attribution:
    • esprehn #1

Against the grain

  1. 01

    Rejecting HTML email is not operationally realistic

    Blanket advice to ignore HTML mail was called dangerous because many jobs depend on messages whose meaning, branding, or workflow breaks when reduced to plain text. That cuts against the dominant purist view. The practical problem is not whether HTML email is bad in theory. It is how to contain it without breaking normal business communication.

    Do not base policy on the assumption that users can simply opt out of HTML mail. Build safer defaults and clearer isolation for the cases people cannot avoid.

      Attribution:
    • ranger_danger #1
  2. 02

    Rich email was not purely an accident

    The claim that HTML email just appeared with no standards thinking was pushed back on. MIME predated HTML, and there were attempts in the Internet Engineering Task Force to define a constrained HTML profile for email before the effort collapsed. That makes the ecosystem look less like pure negligence and more like a standards failure followed by vendor drift.

    When a risky format survives for decades, assume path dependence and failed coordination, not just one bad vendor decision. That usually means migration plans will be harder than technical purists expect.

      Attribution:
    • Arnt #1
    • chuckadams #1

In plain english

CSS
Cascading Style Sheets, the web language used to control how HTML content looks and is laid out.
exfiltrate
To secretly extract data from a system and send it to an attacker.
HTML
HyperText Markup Language, the standard markup language used to structure web pages and rich email content.
MIME
Multipurpose Internet Mail Extensions, a standard that lets email carry formatted text, attachments, and different content types.
URL fragment
The part of a URL after the # symbol, which is usually handled by the browser and not sent to the server.
webmail
An email service used through a web browser instead of a dedicated email client application.

Reference links

Email client compatibility references

Alternative email client and service ideas

  • Cock.li Cock-Mail
    Mentioned as an alternative approach that claims to reduce some of the risks around email rendering

Standards and background material

  • RFC tree PDF mirror
    Shared in a side discussion about the standards history behind rich email and related protocols