Skip to content
XSS Disclosed report Intermediate

Roundcube Webmail Style Sanitizer can be bypassed using CSS Character Escapes

The style sanitizer in Roundcube Webmail can be bypassed by using CSS character escapes to create HTML entities, allowing arbitrary inline CSS such as url() to be injected. An attacker can send a malicious email that, when opened in HTML mode, causes the victim's browser to make a request to an attacker-controlled URL, revealing the victim's IP address and user agent.

somerandomdev Follow

Originally disclosed on HackerOne

Medium 4.3 View original
  • Triaged in 3 days
  • Fixed in 17 days
  • Disclosed after 48 days

Summary:

The style sanitizer in Roundcube Webmail can be bypassed by creating HTML entities using CSS character escapes. This allows using arbitrary inline CSS, like e.g. url(), and retrieve the IP address and user agent of the person reading the email.

Steps To Reproduce:

  1. Send an HTML email to your account with the following contents:
HTML
<div style='content: "\0026quot;; background: url(//http.cat/418); content:""; width: 100%; height: 100%;'>hi, this shouldn't work :(</div>
  1. Open the email in Roundcube in the HTML mode

The background image will be applied to the element, causing a HTTP request to https://http.cat/418

Supporting Material/References:

image.png
image.png From the original on HackerOne
image.png
image.png

Explanation

\0026 is a CSS entity and will be decoded to &. Together with the quot; afterwards, this will close the string token and cause the rest of the string token to be interpreted as CSS.

image.png
image.png From the original on HackerOne

Impact

An attacker can send a malicious email to a victim and retrieve the victim's IP address and user agent.

The original report as published on HackerOne, by somerandomdev. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the sanitizer does not properly decode CSS character escapes before checking for dangerous CSS properties, allowing an attacker to construct a string that closes a CSS string token and injects arbitrary CSS.

Impact

An attacker can send a malicious email to a victim and retrieve the victim's IP address and user agent.

What the attacker needed

Victim uses Roundcube webmail; victim opens email in HTML mode

How it was found

  1. Send an HTML email to your account with a crafted style attribute containing CSS character escapes.
  2. Open the email in Roundcube in HTML mode.
  3. The background image is applied, causing an HTTP request to the attacker's URL.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

Roundcube is a webmail program. It tries to clean up CSS (the code that styles web pages) in emails so that attackers cannot track you. This report shows a clever trick using special character codes in CSS to sneak past that cleaning, so an attacker can make your email program load a hidden image from their server, which tells them your IP address and browser details.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

More from Nextcloud

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.