Skip to content
Info disclosure Write-up Intermediate

Journey through Google referer leakage bugs.

Several Google products leaked sensitive URLs, including shareable-link identifiers, through the Referer header to external sites.

Sree Ram KL Follow

Published on thesecurityexperts.wordpress.com

Bounty$4,634total stated by author View original

Hi there, This write-up is a walk-through to the misconfiguration which leaks sensitive URL through referer header.This affected various Google products and has been fixed now.

Sree Ram KL, on thesecurityexperts.wordpress.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

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

Google products let users share documents and projects through shareable links: you generate a unique link for a project or document, and anyone holding that link gets access to it, either to view or to modify. The link itself is the credential. If the unique ID inside it leaks, the sharing model collapses.

This write-up walks through a misconfiguration that leaked sensitive URLs through the Referer header. It affected several Google products and has since been fixed. The products involved were Google Colab, YouTube, YouTube Gaming and Google Fusion Tables.

google-bug-bounty-program
google-bug-bounty-program From the original on thesecurityexperts.wordpress.com

Setup

The work was done with Burp Suite, mainly its HTTP history, plus a public page at https://whatismyreferer.com that displays the value of your Referer header. No special accounts or roles are described beyond ordinary use of each product.

Finding it

A write-up about an XSS in Google Colab prompted a look at Google Colab. After about an hour of poking around to learn the site's behaviour, the import-project-from-GitHub feature stood out. Features like that are prone to SSRF, so it was tested for SSRF first, without success.

Exploitation

Step 1: read the import request in Burp

To look at the API queries and requests, the HTTP history tab in Burp Suite was used. There, the Google Colab link with its unique ID was found reflected in the Referer header of the GitHub API call made to import a project.

Screenshot from 2018-12-31 19-53-24
Screenshot from 2018-12-31 19-53-24 From the original on thesecurityexperts.wordpress.com

GitHub would therefore be able to see the unique IDs of all Google Colab users who used the import feature. In most applications that would be harmless, because knowing a unique ID without authentication does not by itself do damage. Colab is the exception: because projects can be shared by link, anyone who obtains the leaked link can access the projects or documents of users who enabled share-by-link.

Impact: a person with access to the GitHub logs can see all shareable links of Google Colab.

Reward: $3133.7. The report's own guess is that the reward was high because the normal flow of the website was itself vulnerable, with no malicious interaction required.

Step 2: YouTube, and why the obvious path fails

Since Google had the same sharing feature on several other sites, similar bugs were expected elsewhere. Unlisted YouTube videos are the obvious shareable URL on YouTube, so a link was commented on a video and then clicked. YouTube's redirector gets in the way: it first redirects the URL to a form like:

Text
https://www.youtube.com/redirect?q=http%3A%2F%2Fevil.com

Because of that redirect, the Referer header always carries the value https://www.youtube.com/redirect rather than the page the link was clicked from.

Step 3: YouTube Gaming

Back on the YouTube home page, a link called YouTube Gaming led to another subdomain, https://gaming.youtube.com. Being a separate subdomain, it was worth trying the same bug there:

  1. A random video was opened.
  2. Rather than opening Burp, the link https://whatismyreferer.com was pasted (the site displays the value of your Referer header).
  3. The link was clicked.

Surprisingly, it leaked the referer ID with no redirection in between. That leaks the URL of unlisted Gaming videos. The reward was $500 from Google VRP.

Step 4: Google Fusion Tables

Looking for similar endpoints across Google subdomains led to Google Fusion Tables (https://fusiontables.google.com), which also lets you share a document by link. It has an option to insert a link in the description. https://whatismyreferer.com was inserted there and clicked, and the shareable link to the document was disclosed again. Another $500.

Step 5: the fix that came back

A week after the YouTube Gaming report, the issue was fixed and verified from both ends. A month later, Google News carried a major update to YouTube Gaming, so https://gaming.youtube.com was visited again. The site had changed a lot, including the logo. New development updates carry a good chance of reverting a security fix, so the test was repeated, and the instinct was right: the fix had been reverted and the bug was present on the same endpoint again. The same issue was reported and rewarded with $500 again.

af00faaf5ae314fc805c7154ec4677b6.gif
af00faaf5ae314fc805c7154ec4677b6.gif From the original on thesecurityexperts.wordpress.com

Root cause

Outbound requests made by the product carried the full URL of the current page, including the shareable link with its unique ID, in the Referer header. The link is the only credential needed for share-by-link access, so sending it to a third party hands over access. The redirector on the main YouTube domain meant the Referer header always carried the redirect URL, so the main site did not show the bug while the Gaming subdomain did. The report does not describe the server-side change that fixed it.

Impact

Anyone with access to the third party's logs, in the Colab case GitHub, could see the shareable links of users who enabled share-by-link. With those links they can access the corresponding projects or documents. The report's own guess is that no malicious interaction was needed, since the normal flow of the website was itself vulnerable.

Fix

The affected issues have been fixed. The report does not state what was changed. The YouTube Gaming fix was verified from both ends, and it was later reverted by a development update, after which it was reported and fixed again.

Variants to test

  • Import or integration features that make server-side calls to a third party (like Colab's GitHub import): check the Referer on the outbound request for the current page URL. A positive result is the full shareable link appearing in the third party's request.
  • Share-by-link products where a link can be placed in a description or comment: insert https://whatismyreferer.com and click it. A positive result is the shareable link shown as the referer.
  • Subdomains of a product that already has a redirector: test the subdomain directly, since the redirector may only exist on the main domain. A positive result is the page URL reaching the destination without redirection.
  • Recently updated products: retest a previously fixed endpoint after a major release, since fixes can be reverted. A positive result is the old leak reappearing on the same endpoint.

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

What happened, in plain words

Many Google products let you share a document, a project or a video by handing someone a special link. The link contains a long random-looking code, called a unique ID, and that code is the only thing needed to get in. There is no separate password: if you have the link, you have access. Think of it like a self-storage locker whose key is taped to the door: whoever finds the key can open the locker, and nobody at the desk asks for ID.

This write-up is about a mistake that made those keys leak to other websites. When you click a link on a web page, your browser usually tells the destination site where you came from. That little note is called the Referer header. Normally it is harmless: the destination learns "this visitor came from page X". But if page X is a Google page whose address contains a shareable link, then the note hands the key to the destination site. The destination site, and anyone who can read its logs, now holds a working link to your private document.

The same mistake turned up in several Google products: Google Colab, YouTube, YouTube Gaming and Google Fusion Tables. The affected issues have been fixed.

google-bug-bounty-program
google-bug-bounty-program From the original on thesecurityexperts.wordpress.com

The pieces you need to know first

Before the steps make sense, here are the few ideas the whole story rests on.

A header is a small line of text that a browser and a web server attach to every request and response, alongside the actual content. Think of an envelope: the letter is the page you asked for, and the headers are the notes written on the outside, such as "from", "to" and "please reply by Friday".

The Referer header is the "from" note. When you are on page A and click a link to page B, your browser sends a request to B and includes a header saying, in effect, "I came from A". Webmasters use it for statistics and for checking which sites send them traffic. The name is a historical misspelling of "referrer"; the misspelling is the real name of the header.

An API is a way for one piece of software to talk to another without a human clicking anything. When you press a button on a website and the page fetches data in the background, it is usually calling an API: a fixed address that accepts a request and returns an answer, often in a compact data format rather than a pretty web page. Think of a restaurant: the menu and the dining room are the website, and the kitchen hatch where orders go in and plates come out is the API.

A unique ID here is a long random string inside a shareable link. It is not a password in the usual sense, but it works like one: it is unguessable, and possessing it is enough.

A subdomain is a named section of a larger domain. In gaming.youtube.com, the gaming part is the subdomain of youtube.com. Different subdomains can be built and configured by different teams, so a protection present on the main site is not automatically present on a subdomain.

A redirect is when a server answers "not here, go there instead" and your browser automatically follows to the new address. A redirector is a page whose whole job is to do that, usually so the site can warn you before sending you to an external link.

SSRF, server-side request forgery, is a bug where a website feature that fetches a URL on your behalf can be tricked into fetching something it should not, such as an internal address the outside world cannot reach. It is worth testing wherever a product offers to import or fetch something from elsewhere.

Burp Suite is a tool that sits between your browser and the websites you visit and records every request and response. Its HTTP history tab is simply the list of everything that passed through, in order. It is the equivalent of a phone call log for your browser.

XSS, cross-site scripting, is a bug where an attacker gets their own code to run inside someone else's web page. It is not the bug in this write-up, but reading about one is what started the hunt.

VRP stands for Vulnerability Reward Program: Google's scheme for paying people who report security bugs to them.

The setup

The work was done with Burp Suite, mainly its HTTP history, plus a public page at https://whatismyreferer.com that displays the value of your Referer header. That second tool is the simple part: you open it, and it prints back the "from" note your browser sent. If the note contains a private link, the page shows you the private link.

No special accounts or roles are described beyond ordinary use of each product. In plain terms: the victim must have switched sharing on, and must then do something that makes the Google product contact another company's server.

Finding it

A write-up about an XSS in Google Colab prompted a look at Google Colab. Colab is Google's online notebook for writing and running code in the browser; you can create a project there and, as with Google Docs, share it with a link.

After about an hour of poking around to learn the site's behaviour, the import-project-from-GitHub feature stood out. GitHub is a website where programmers store and share code; the feature lets you pull a project from GitHub into Colab. Features like that are prone to SSRF, because the server has to go and fetch something from another site on your behalf, so it was tested for SSRF first, without success.

Exploitation

Step 1: read the import request in Burp

To look at the API queries and requests, the HTTP history tab in Burp Suite was used. The reason is simple: the browser shows you the finished page, but the interesting part, the raw conversation between browser and server, is hidden. Burp keeps a copy of every one of those conversations so you can read them afterwards.

There, the Google Colab link with its unique ID was found reflected in the Referer header of the GitHub API call made to import a project. In other words, when Colab's servers contacted GitHub to fetch the project, they introduced themselves with the address of the Colab page the user was on, and that address contained the shareable link.

Screenshot from 2018-12-31 19-53-24
Screenshot from 2018-12-31 19-53-24 From the original on thesecurityexperts.wordpress.com

GitHub would therefore be able to see the unique IDs of all Google Colab users who used the import feature. In most applications that would be harmless, because knowing a unique ID without authentication does not by itself do damage. Colab is the exception: because projects can be shared by link, anyone who obtains the leaked link can access the projects or documents of users who enabled share-by-link.

Impact: a person with access to the GitHub logs can see all shareable links of Google Colab. Logs are the records a server keeps of the requests it received; they are kept for troubleshooting and auditing, and they are readable by the company that owns the server.

Reward: $3133.7. The report's own guess is that the reward was high because the normal flow of the website was itself vulnerable, with no malicious interaction required. That is, the victim did not have to be tricked into clicking anything unusual; using the product normally was enough.

Step 2: YouTube, and why the obvious path fails

Since Google had the same sharing feature on several other sites, similar bugs were expected elsewhere. Unlisted YouTube videos are the obvious shareable URL on YouTube: an unlisted video does not appear in search or on your channel, but anyone with its link can watch it, which is exactly the share-by-link model.

So a link was commented on a video and then clicked. The idea was: if the comment page's address leaks as the referer, and that address is the video page, then the video's link leaks. YouTube's redirector gets in the way: it first redirects the URL to a form like:

Text
https://www.youtube.com/redirect?q=http%3A%2F%2Fevil.com

Line by line: https://www.youtube.com/redirect is the redirector page; the ? starts the list of parameters passed to it; q= is the parameter holding the destination; and http%3A%2F%2Fevil.com is the destination address with its punctuation encoded, where %3A stands for : and %2F stands for /, so it decodes to http://evil.com. Encoding exists so that characters with special meaning in a URL can be carried inside another URL without confusion.

Because of that redirect, the Referer header always carries the value https://www.youtube.com/redirect rather than the page the link was clicked from. The redirector acts as a screen: the destination only ever learns that the visitor came from the redirector, never from the video page.

Step 3: YouTube Gaming

Back on the YouTube home page, a link called YouTube Gaming led to another subdomain, https://gaming.youtube.com. Being a separate subdomain, it was worth trying the same bug there, on the reasoning that a separate site may be built and configured separately, and may not have the same redirector in front of its links.

  1. A random video was opened.
  2. Rather than opening Burp, the link https://whatismyreferer.com was pasted (the site displays the value of your Referer header).
  3. The link was clicked.

Step 2 is the shortcut: instead of capturing traffic and reading headers by hand, you point the browser at a page whose entire purpose is to show you the header. If the page shows a private link, the leak is proven.

Surprisingly, it leaked the referer ID with no redirection in between. That leaks the URL of unlisted Gaming videos, because the address of the video page is what got passed along. The reward was $500 from Google VRP.

Step 4: Google Fusion Tables

Looking for similar endpoints across Google subdomains led to Google Fusion Tables (https://fusiontables.google.com), which also lets you share a document by link. Fusion Tables was a Google service for storing and visualising tables of data, and like the others it had share-by-link.

It has an option to insert a link in the description. https://whatismyreferer.com was inserted there and clicked, and the shareable link to the document was disclosed again. The reasoning is the same as before: the description lives on the document's own page, so if that page's address travels as the referer, the shareable link travels with it. Another $500.

Step 5: the fix that came back

A week after the YouTube Gaming report, the issue was fixed and verified from both ends. "Verified from both ends" means the reporter checked that the leak was gone and Google confirmed the same, rather than one side assuming it.

A month later, Google News carried a major update to YouTube Gaming, so https://gaming.youtube.com was visited again. The site had changed a lot, including the logo. New development updates carry a good chance of reverting a security fix, because a fix is a small change to code, and a large rewrite can replace the code the fix lived in. So the test was repeated, and the instinct was right: the fix had been reverted and the bug was present on the same endpoint again. The same issue was reported and rewarded with $500 again.

af00faaf5ae314fc805c7154ec4677b6.gif
af00faaf5ae314fc805c7154ec4677b6.gif From the original on thesecurityexperts.wordpress.com

Root cause

Outbound requests made by the product carried the full URL of the current page, including the shareable link with its unique ID, in the Referer header. The link is the only credential needed for share-by-link access, so sending it to a third party hands over access. The redirector on the main YouTube domain happened to strip the useful value, which is why the main site did not show the bug while the Gaming subdomain did. The report does not describe the server-side change that fixed it.

Impact

Anyone with access to the third party's logs, in the Colab case GitHub, could see the shareable links of users who enabled share-by-link. With those links they can access the corresponding projects or documents. The report's own guess is that no malicious interaction was needed, since the normal flow of the website was itself vulnerable.

Fix

The affected issues have been fixed. The report does not state what was changed. The YouTube Gaming fix was verified from both ends, and it was later reverted by a development update, after which it was reported and fixed again.

Variants to test

  • Import or integration features that make server-side calls to a third party (like Colab's GitHub import): check the Referer on the outbound request for the current page URL. A positive result is the full shareable link appearing in the third party's request.
  • Share-by-link products where a link can be placed in a description or comment: insert https://whatismyreferer.com and click it. A positive result is the shareable link shown as the referer.
  • Subdomains of a product that already has a redirector: test the subdomain directly, since the redirector may only exist on the main domain. A positive result is the page URL reaching the destination without redirection.
  • Recently updated products: retest a previously fixed endpoint after a major release, since fixes can be reverted. A positive result is the old leak reappearing on the same endpoint.

Glossary

  • API: a fixed address where one piece of software sends a request to another and gets an answer back, usually without a human seeing a web page.
  • Burp Suite: a tool that sits between your browser and websites and records every request and response so you can inspect them.
  • Header: a short line of text attached to a web request or response, carrying information about it rather than its content.
  • HTTP history: the tab in Burp Suite listing every request and response that passed through, in order.
  • Impact: what an attacker could actually do with a bug, as opposed to how the bug works.
  • Logs: records a server keeps of the requests it received, readable by the company that owns the server.
  • Redirect: a server's answer telling the browser to go to a different address instead, which the browser follows automatically.
  • Redirector: a page whose purpose is to redirect visitors, often to warn them before sending them to an external site.
  • Referer header: the header in which a browser tells a site which page the visitor came from; the name is a historical misspelling of "referrer".
  • Root cause: the underlying reason a bug exists, as opposed to where it was noticed.
  • Shareable link: a link containing a unique ID that grants access to a document, project or video to anyone who holds it, with no separate login.
  • SSRF (server-side request forgery): a bug where a feature that fetches a URL on your behalf can be tricked into fetching something it should not.
  • Subdomain: a named section of a larger domain, such as gaming in gaming.youtube.com.
  • Unique ID: a long random string inside a shareable link that cannot realistically be guessed and works as the key to the shared item.
  • Unlisted video: a video that does not appear in search or on a channel, but can be watched by anyone who has its link.
  • URL encoding: writing characters such as : and / as codes like %3A and %2F so they can be carried inside another URL without confusion.
  • VRP (Vulnerability Reward Program): a scheme that pays people for reporting security bugs to the company that owns the software.
  • XSS (cross-site scripting): a bug where an attacker gets their own code to run inside someone else's web page.

More by Sree Ram KL

View all

1 more disclosed report, best first.

More from Google

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.