Skip to content
Info disclosure Disclosed report Beginner CVE-2021-32707

Bypass of privacy filter / tracking pixel blocker

The email client's privacy filter blocks remote images to prevent tracking, but it fails to block images loaded via CSS properties like list-style-image and background-image. An attacker can embed a tracking pixel using these CSS properties to log when a user opens the email and gather their IP address.

foobar7 Follow

Originally disclosed on HackerOne

Bounty$100 Medium 4.7 View original
  • Triaged in 6 hours
  • Fixed in 21 days
  • Paid in 21 days
  • Disclosed after 2 months

Description

When the mail app receives inline images, it will block them for privacy reasons to prevent tracking pixels (The images have been blocked to protect your privacy).

This block works correctly for most remote resources (in addition to images, remote CSS files, iframes, and some CSS attributes are also blocked).

However, it is still possible to inject images via some CSS attributes (specifically, list-style-image and background-image), thus bypassing the block and enabling tracking of users.

POC

Send a mail with the following body to an email address that is connected to Nextcloud Mail (the HTML code can for example be sent via thunderbird by clicking insert -> HTML):

    <style>
        big {
            background-image: url(https://www.google.com/logos/doodles/2021/celebrating-frank-kameny-6753651837108392-l.png);

        }
        ul {
            list-style-image: url(https://www.google.com/logos/doodles/2021/celebrating-frank-kameny-6753651837108392-l.png);
        }
    </style>
    <big>test</big>

    <ul>
      <li>Item 1</li>
      <li>Item 2</li>
    </ul>

Open the message to see that the remote image is included directly, bypassing the privacy filter. An attacker can now replace www.google.com with a log server they control to log when users open the mail.

Impact

bypass of image privacy filter which prevents tracking scripts from gathering users IP addresses and information on when they view an email.

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

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 5 min read.

Context

Nextcloud Mail is the mail client that ships as part of the Nextcloud suite. Like most modern webmail, it renders HTML messages but tries to protect the reader from remote content that could be used for tracking. When a message contains inline images, the app blocks them and shows the notice The images have been blocked to protect your privacy.

The block is not limited to <img> elements. According to the report, remote CSS files, iframes and some CSS attributes are also blocked. The purpose of the feature is to stop a sender from learning that, and when, a recipient opened a message, and from collecting the recipient's IP address through a remote fetch.

The report was filed against the nextcloud/mail asset in the Nextcloud program on HackerOne by the researcher foobar7. It is rated medium severity with a CVSS score of 4.7, classified as Information Disclosure, and a bounty of 100.00 USD was paid. It was disclosed on 2021-08-11.

Setup

The report describes no special accounts, roles, tools or versions. The only precondition it states is a mailbox connected to Nextcloud Mail, plus a way to send an HTML message to that address. The researcher names Thunderbird as one way to compose the message: insert the HTML with insert -> HTML and send it.

Finding it

The researcher started from the behaviour the privacy filter is supposed to have: inline images are blocked, and so are remote CSS files, iframes and some CSS attributes. The observation was that the filter does not cover every way a browser can be made to fetch a remote resource. Two CSS attributes in particular, list-style-image and background-image, still cause the client to load a remote URL. Because those fetches happen, the block can be bypassed and the user tracked.

Exploitation

Step 1: send an HTML message that loads images through CSS

The researcher sends a mail whose body contains a <style> block and two elements that use the CSS properties in question. The HTML can be inserted in Thunderbird via insert -> HTML.

HTML
    <style>
        big {
            background-image: url(https://www.google.com/logos/doodles/2021/celebrating-frank-kameny-6753651837108392-l.png);

        }
        ul {
            list-style-image: url(https://www.google.com/logos/doodles/2021/celebrating-frank-kameny-6753651837108392-l.png);
        }
    </style>
    <big>test</big>

    <ul>
      <li>Item 1</li>
      <li>Item 2</li>
    </ul>

The <style> block defines two rules. The big rule sets background-image to a remote PNG, so the <big>test</big> element paints that image as its background. The ul rule sets list-style-image to the same remote PNG, so each list item marker in the <ul> is drawn from that URL. Neither rule uses an <img> tag, so the image is requested through styling rather than an image element.

Step 2: open the message

When the recipient opens the message, the remote image is included directly, bypassing the privacy filter. The report does not describe the response or any server-side log; the visible result is simply that the image is rendered instead of being blocked.

Step 3: point the URL at a logging server

Because the URL is fetched by the recipient's client, an attacker can replace www.google.com with a log server they control. Each time a user opens the mail, the client requests the image from that server, and the server records the hit. That is the tracking primitive the privacy filter exists to prevent.

Root cause

The filter appears to work by blocking known remote-resource vectors: images, remote CSS files, iframes and some CSS attributes. It does not cover list-style-image and background-image, so CSS that references a remote URL through those properties passes through and the browser fetches it. The report does not describe the implementation, so the exact reason those two properties were missed is not stated;

Impact

The bypass defeats the image privacy filter, which is meant to stop tracking scripts from gathering users' IP addresses and information about when they view an email. A sender who can deliver an HTML message to a Nextcloud Mail user can therefore learn that the message was opened, when, and from which address, provided the client loads the CSS-referenced resource. The report does not discuss what happens when the user has disabled remote content by other means, or how different clients render the message.

Fix

Variants to test

  • Other CSS properties that accept a URL and cause a fetch, such as border-image, cursor, content with url(), mask-image, shape-outside and @font-face src. A positive result is that the remote resource is requested when the message is opened while the privacy notice is shown or the block is otherwise active.
  • The same properties inside inline style attributes rather than a <style> block. A positive result is the same remote fetch.
  • Remote CSS files and iframes, which the report says are blocked, to confirm the baseline and to see whether the block can be reached through a different element or attribute.
  • The same payload against other webmail clients that advertise a tracking-pixel blocker. A positive result is a request to the attacker-controlled URL when the message is opened.

Hunting notes

This kind of bug hides in the gap between a blocklist of resource types and the full set of ways HTML and CSS can make a browser fetch a URL. During recon, look for mail or messaging products that advertise a privacy or tracking-pixel blocker, then read what the notice says and test whether the block covers CSS-driven loads as well as <img>. The signal is a product that blocks images but still renders styled HTML.

The researcher used a Google-hosted image URL to demonstrate that the image is rendered despite the filter, then explained that the same URL can point at a server the attacker controls to log opens. That combination, a visible bypass plus a clear tracking consequence, is what makes the report actionable for the program.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 8 min read.

What happened, in plain words

Nextcloud Mail is a webmail program: it is the part of the Nextcloud suite that lets you read and send email inside a web browser, much like Gmail or Outlook on the web. Modern email is not plain text only; a message can contain HTML, the same language web pages are written in. That is what lets a newsletter look like a designed page with colours, headings and pictures.

The problem with pictures in email is that a picture is usually not inside the message itself. The message only contains a link to a picture stored on some server on the internet. When you open the message, your mail program follows that link and downloads the picture. The server that hosts the picture therefore learns two things: that someone downloaded it, and the address the download came from. If the sender puts a unique link in each copy of the message, they can tell exactly which recipient opened it and roughly when. A tiny invisible picture used this way is called a tracking pixel.

To protect readers, Nextcloud Mail blocks these remote pictures by default and shows the notice The images have been blocked to protect your privacy. The block is broader than just pictures: according to the report, remote CSS files, iframes and some CSS attributes are blocked too. CSS is the language that describes how an HTML page should look, and an iframe is a page embedded inside another page.

The researcher foobar7 found that the block does not cover every route to a remote file. Two CSS attributes, list-style-image and background-image, still make the mail program download a remote picture. A sender can therefore hide a tracking picture in the styling of a message, and it will load even though the privacy notice is active. The report was filed against the nextcloud/mail asset in the Nextcloud program on HackerOne. It is rated medium severity with a CVSS score of 4.7, classified as Information Disclosure, and a bounty of 100.00 USD was paid. It was disclosed on 2021-08-11.

Setting up

The report describes no special accounts, roles, tools or versions. The only precondition it states is a mailbox connected to Nextcloud Mail, plus a way to send an HTML message to that address. The researcher names Thunderbird, a desktop mail program, as one way to compose the message: you insert the HTML with insert -> HTML and send it.

Finding it

The researcher started from what the privacy filter is supposed to do: block inline images, and also remote CSS files, iframes and some CSS attributes. The observation was that the filter does not cover every way a browser can be made to fetch a remote resource. Two CSS attributes in particular, list-style-image and background-image, still cause the client to load a remote URL. Because those downloads happen, the block can be bypassed and the user tracked.

Exploitation

Step 1: send an HTML message that loads images through CSS

The researcher sends a mail whose body contains a <style> block and two elements that use the CSS properties in question. The HTML can be inserted in Thunderbird via insert -> HTML.

HTML
    <style>
        big {
            background-image: url(https://www.google.com/logos/doodles/2021/celebrating-frank-kameny-6753651837108392-l.png);

        }
        ul {
            list-style-image: url(https://www.google.com/logos/doodles/2021/celebrating-frank-kameny-6753651837108392-l.png);
        }
    </style>
    <big>test</big>

    <ul>
      <li>Item 1</li>
      <li>Item 2</li>
    </ul>

Line by line:

  • <style> opens a block of CSS rules. Everything until </style> tells the browser how parts of the message should look.
  • big { starts a rule that applies to every <big> element, an HTML tag that makes text slightly larger.
  • background-image: url(...) sets the background of that element to a picture. The url(...) part is a link to a file on the internet, here a PNG image on www.google.com. When the browser draws the element, it has to download that file first.
  • ul { starts a rule for every <ul> element, an unordered list, the kind that shows bullet points.
  • list-style-image: url(...) replaces the normal bullet with a picture taken from that link. Again the browser must download the file to draw the bullet.
  • </style> closes the CSS block.
  • <big>test</big> is the element that gets the background picture. The word test is what the reader sees; the picture sits behind it.
  • <ul> and </ul> wrap a list, and each <li> is one list item. Each bullet in that list is drawn from the remote picture.

The key point is that neither rule uses an <img> tag, so the picture is requested because of styling, not because of an image element. The picture is requested because of styling, not because of an image element.

Step 2: open the message

When the recipient opens the message, the remote image is included directly, bypassing the privacy filter. The report does not describe the response or any server-side log; the visible result is simply that the image is rendered instead of being blocked.

Step 3: point the URL at a logging server

Because the URL is fetched by the recipient's client, an attacker can replace www.google.com with a log server they control. Each time a user opens the mail, the client requests the image from that server, and the server records the hit. That is the tracking primitive the privacy filter exists to prevent.

Root cause

The filter appears to work by blocking known remote-resource vectors: images, remote CSS files, iframes and some CSS attributes. It does not cover list-style-image and background-image, so CSS that references a remote URL through those properties passes through and the browser fetches it. The report does not describe the implementation, so the exact reason those two properties were missed is not stated;

Impact

The bypass defeats the image privacy filter, which is meant to stop tracking scripts from gathering users' IP addresses and information about when they view an email. A sender who can deliver an HTML message to a Nextcloud Mail user can therefore learn that the message was opened, when, and from which address, provided the client loads the CSS-referenced resource. The report does not discuss what happens when the user has disabled remote content by other means, or how different clients render the message.

Fix

Variants to test

  • Other CSS properties that accept a URL and cause a fetch, such as border-image, cursor, content with url(), mask-image, shape-outside and @font-face src. A positive result is that the remote resource is requested when the message is opened while the privacy notice is shown or the block is otherwise active.
  • The same properties inside inline style attributes rather than a <style> block. A positive result is the same remote fetch.
  • Remote CSS files and iframes, which the report says are blocked, to confirm the baseline and to see whether the block can be reached through a different element or attribute.
  • The same payload against other webmail clients that advertise a tracking-pixel blocker. A positive result is a request to the attacker-controlled URL when the message is opened.

Hunting notes

This kind of bug hides in the gap between a blocklist of resource types and the full set of ways HTML and CSS can make a browser fetch a URL. During recon, look for mail or messaging products that advertise a privacy or tracking-pixel blocker, then read what the notice says and test whether the block covers CSS-driven loads as well as <img>. The signal is a product that blocks images but still renders styled HTML.

The researcher used a Google-hosted image URL to demonstrate that the image is rendered despite the filter, then explained that the same URL can point at a server the attacker controls to log opens. That combination, a visible bypass plus a clear tracking consequence, is what makes the report actionable for the program.

Glossary

  • HTML: the language used to structure web pages and rich email messages, made of tags such as <big> and <ul>.
  • CSS: the language that describes how HTML should look, for example colours, fonts and background pictures.
  • CSS attribute (property): one named setting inside CSS, such as background-image, that controls one aspect of appearance.
  • <style> block: a section of an HTML document that contains CSS rules instead of visible content.
  • background-image: a CSS property that puts a picture behind an element.
  • list-style-image: a CSS property that replaces the normal bullet of a list with a picture.
  • url(...): the CSS notation that points at a file, usually on a remote server, to be downloaded.
  • <img> tag: the HTML element for showing a picture; the element the privacy filter is built to catch.
  • <big> tag: an HTML element that makes its text slightly larger.
  • <ul> / <li>: HTML tags for an unordered (bulleted) list and for one item inside it.
  • iframe: a page embedded inside another page.
  • Tracking pixel: a tiny, often invisible remote picture whose download tells the sender that, and when, a message was opened.
  • Privacy filter / tracking-pixel blocker: a feature that stops a mail program from downloading remote content.
  • Remote resource: any file the mail program has to download from the internet to display a message, such as a picture, stylesheet or font.
  • Information Disclosure: a vulnerability class where something that should stay private, such as a user's IP address or reading habits, becomes visible to someone who should not see it.
  • IP address: the numeric address a device uses on a network, which can reveal roughly where a connection comes from.
  • CVSS score: a standard number from 0 to 10 that rates how serious a vulnerability is.
  • Severity: a label such as low, medium or high that summarises the risk of a vulnerability.
  • Bounty: a payment a program makes to a researcher who reports a valid vulnerability.
  • HackerOne: a platform where organisations run bug bounty programs and researchers submit reports.
  • Asset: the specific product or component a report is filed against, here nextcloud/mail.
  • Recon: the early phase of research where you look at a product and its features to decide what to test.
  • Blocklist: a list of things that are forbidden; anything not on the list is allowed through.
  • Payload: the input, here the HTML message body, that is used to trigger the behaviour being tested.
  • POC (proof of concept): a minimal demonstration that a vulnerability is real.
  • Thunderbird: a desktop email program that can send HTML messages, used here to compose the test mail.

More by foobar7

View all

17 more disclosed reports, best first.

More from Nextcloud

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.