Multiple Authorization bypass issues in Google's Richmedia Studio
Published on ehpus.com
Ah, Google research grants, how effective you are! It seems as if exactly in these times when my energy levels are low, and I just-can’t-get-motivated to sit down and do something, exactly then a new ‘research grant’ lands in my mailbox and kicks me into gear.
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.
Context
Richmedia Studio is a Google marketing campaign management platform. Campaign administrators create campaigns, upload media to them (HTML pages, videos, images and so on), grant advertisers access to a campaign, run it through QA, and leave comments. All of this is governed by a role and permission system.
The application is not something you can stumble upon. If your account is not configured to use it, requesting the studio URL does not even return an authorisation error: you are simply navigated away. Access requires filling in a support form, and if Google grants access you receive an email invite.
The research was carried out under a Google vulnerability research grant for October 2020, and the findings were reported to Google.
Setup
The researcher created an account without access to the QA dashboard, and later logged in as a different user to obtain identifiers belonging to another account. Media uploads were made through the studio interface while the browser's network traffic was inspected, and the GWT (Google Web Toolkit) requests used by the application's API were examined directly. A quick script was used to guess similar-looking identifiers.
Finding it
Two things drew attention early. First, uploaded media is not stored in the user's Google Drive and served through a temporary googleusercontent link with a long random ID, as is common in other Google applications. Instead, files are uploaded to a separate domain, s0.2mdn.net. Because that domain is not a Google domain, the browser holds no cookies for it, which raises the question of how authorisation is enforced there.
Second, the links handed to the browser come in two forms: a long preview link and, returned in a separate HTTP response during the upload, a much simpler direct link. The direct link looked guessable, and the role management system looked like a place where a permission check might be missing.
Exploitation
Step 1: media links without authorisation
An example of the preview link returned for an uploaded file:
https://s0.2mdn.net/preview/[redacted]-bButtVLChPwsXnU/ads/richmedia/studio/60019864/[redacted].png
Opening such a link from an anonymised browser showed that no authentication is required. On its own this is not a serious problem, because the preview key is long and cannot realistically be brute-forced or guessed.
Following the network requests during a second upload revealed that a separate HTTP response returns a direct link to the file rather than to its preview:
http://s0.2mdn.net/ads/richmedia/studio/pv2/61580927/20201004040915088/xsspng.png
This direct link is also accessible without authentication, and it can be constructed by an attacker. The first eight digits are the merchant ID, which can be enumerated from the studio application, and the remainder consists of the upload date and a short random number. That makes it a clear IDOR: a guessable link to another user's file, served without any authorisation check.
Google accepted this issue and paid a 500 USD bounty.
Step 2: campaigns of other accounts
The role management system allows an account to be created without access to the QA dashboard. The dashboards differ visibly between an administrator account and a limited account.
With the limited account, requesting the QA page directly was expected to fail. It did not:
The limited user could reach the QA page not only for the campaigns its own account was associated with, but for all campaigns of all accounts. The behaviour looks like a fail-to-true bug: an account with permission to see nothing ends up seeing everything. Google issued a 5000 USD bounty for this one.
Step 3: GWT request identifiers
Richmedia Studio uses GWT for its APIs. The file upload process was revisited with attention on the GWT requests, in particular the HTTP request that retrieves the file download URL (the long preview link seen earlier). Its POST body contained the following:
7|0|8|https://www.google.com/doubleclick/studio/gwt/|[redacted]|com.google.ads.api.gwt.rpc.client.BatchedInvocationService|invoke|com.google.ads.api.gwt.rpc.client.BatchedInvocationRequest/2983766987|com.google.ads.richmedia.studio.ui.common.grubby.client.BatchedInvocationRequestHeaderImpl/3117963532|java.util.ArrayList/4159755760|com.google.ads.richmedia.studio.service.CreativeServiceGwt$GetDownloadArchiveUrlRequest/1562479252|1|2|3|4|1|5|5|6|0|7|1|8|DlQXE|DlQWU|
The GWT serialisation format is opaque at first sight, but the two strings at the end, DlQXE and DlQWU, stood out. Poking around the system showed that these strings are identifiers representing the specific campaign being accessed.
Logging in as a different user produced another pair of identifiers. Sending that pair with the first user's cookies returned the download URL for the second user's files. Because the strings are very short, guessing them is practical: a quick script generating similar-looking identifiers quickly found more that worked, pointing to files belonging to other users.
This bug yielded another 500 USD bounty.
Steps 4 and 5
Further research into the authorisation mechanism produced more issues within a few days, and Google's team agreed that the authorisation in Richmedia Studio needed adjusting.
Root cause
Three distinct weaknesses are described. The media storage domain s0.2mdn.net serves files without any authorisation check, and the direct link format is predictable: merchant ID, upload date and a short random number. The QA dashboard relies on a permission check that fails open, so an account granted no visibility is granted full visibility. The GWT download request trusts short campaign identifiers supplied by the client without verifying that the caller is entitled to the campaign they name.
Impact
An attacker with a Richmedia Studio account could retrieve other users' uploaded media through guessable direct links, read the campaigns of all accounts through the QA page despite having no QA permission, and obtain download URLs for other users' files by guessing short campaign identifiers in GWT requests. The media links required no authentication at all, so the first issue extended beyond studio users to anyone holding or guessing a link.
Fix
Google paid bounties of 500 USD, 5000 USD and 500 USD for the first three issues. The report does not describe the specific code changes made.
Variants to test
- Upload a file in any application that serves media from a separate domain and inspect every response during the upload. A positive result is a second, shorter URL that resolves without cookies.
- Take the short URL format and vary the numeric and random components around your own values. A positive result is a file you did not upload.
- Create a role with no permissions on a dashboard or module and request that page directly. A positive result is the page rendering data rather than an error.
- Capture GWT POST bodies and look for short strings at the end of the serialised argument list. Swap them for values from a second account while keeping the first account's cookies. A positive result is a URL or object belonging to the second account.
- Generate similar-looking short identifiers with a script and replay them. A positive result is any identifier that returns another user's data.
- Check whether an application you cannot access still exists behind a URL, by requesting it with an account that lacks the feature. A positive result is any response other than a redirect away.
What happened, in plain words
A security researcher spent some time looking at a Google product called Richmedia Studio, a tool for managing online advertising campaigns. He found several places where the application did not properly check whether the person asking for something was allowed to see it. In plain terms: files uploaded by one customer could be fetched by anyone who could work out a link, a user with almost no permissions could see every campaign in the system, and a request the browser sends when downloading a file accepted a short code that could be guessed to reach other people's files. Google paid bounties of 500 USD, 5000 USD and 500 USD for the first three issues.
This article walks through the same steps the researcher took, in the same order, explaining each idea from scratch. You only need to know how to use a browser.
What Richmedia Studio is
Richmedia Studio is a Google platform for managing marketing campaigns. Campaign administrators create campaigns, upload media to them (HTML pages, videos, images and so on), give advertisers access to a campaign, run it through QA, and leave comments. All of this is governed by a role and permission system.
A role here means a named bundle of permissions, for example "can see the QA dashboard" or "can upload media". A permission is a single yes/no rule attached to a role. When you log in, the application looks at your role and decides which pages and buttons to show you. The important part for security is that this decision must be made on the server, not just by hiding a button in the browser.
QA stands for quality assurance: a review step where a campaign is checked before it goes live. The QA dashboard is the page where that review happens.
Getting in at all
The application is not something you can stumble upon. If your account is not configured to use it, requesting the studio URL does not even return an authorisation error: you are simply navigated away. Access requires filling in a support form, and if Google grants access you receive an email invite.
Why does this matter? Because most security testing starts with knowing a feature exists. If a page silently redirects you somewhere else when you are not allowed in, you never learn that the page is there. The researcher notes that this is probably why he had never come across the app before, despite spending significant effort searching for Google's systems. It is a useful lesson: an application you cannot see may still exist behind a URL.
The research was carried out under a Google vulnerability research grant for October 2020, and the findings were reported to Google.
Setting up
The researcher created an account without access to the QA dashboard, and later logged in as a different user to obtain identifiers belonging to another account. Media uploads were made through the studio interface while the browser's network traffic was inspected, and the GWT requests used by the application's API were examined directly. A quick script was used to guess similar-looking identifiers.
Two terms worth explaining here:
- Network traffic inspection: every browser has a developer tools panel (usually opened with F12) with a Network tab. It lists every request the page makes to the server and every response that comes back. You can click any entry and read the exact URL, the headers and the body. This is how you see what the application is really doing, rather than what it shows on screen.
- API: short for Application Programming Interface. In a web application it means the set of server endpoints the page calls behind the scenes to fetch or change data. The page you see is a shell; the data arrives from these calls. If you can call an API endpoint directly, you can often do things the interface does not offer.
Finding it
Two things drew attention early.
First, uploaded media is not stored in the user's Google Drive and served through a temporary googleusercontent link with a long random ID, as is common in other Google applications. Instead, files are uploaded to a separate domain, s0.2mdn.net. Because that domain is not a Google domain, the browser holds no cookies for it, which raises the question of how authorisation is enforced there.
A cookie is a small piece of data a website asks your browser to store and send back on every later request to that same site. It is how a site recognises you after you log in: the cookie carries a session identifier, and the server looks it up to know who you are. The key detail is same site: a cookie set by google.com is not sent to s0.2mdn.net. So if a file is served from a different domain, the server there cannot simply look at your Google cookie to decide whether you may see the file. It needs some other check, and the researcher wanted to know what that check was.
Second, the links handed to the browser come in two forms: a long preview link and, returned in a separate HTTP response during the upload, a much simpler direct link. The direct link looked guessable, and the role management system looked like a place where a permission check might be missing.
An HTTP response is what a server sends back after your browser makes a request. A single action in a web page, such as uploading a file, usually triggers several requests and responses in sequence. Watching all of them, not just the one the page shows you, is often where the interesting detail is.
Step 1: media links without authorisation
An example of the preview link returned for an uploaded file:
https://s0.2mdn.net/preview/[redacted]-bButtVLChPwsXnU/ads/richmedia/studio/60019864/[redacted].png
Reading this link piece by piece:
https://s0.2mdn.netis the domain serving the file. It is not a Google domain, so no Google cookies travel with the request./preview/is the path segment that tells the server this is a preview link rather than a direct one.[redacted]-bButtVLChPwsXnUis a long random-looking key. This is the part that makes the link hard to guess./ads/richmedia/studio/60019864/contains a number, which the researcher later identifies as a merchant ID.[redacted].pngis the file name, built from the merchant ID, a timestamp and the original name.
Opening such a link from an anonymised browser showed that no authentication is required. An anonymised browser here means one with no logged-in session, for example a private window or a different browser profile. If the file loads there, the server is not checking who you are.
On its own this is not a serious problem, because the preview key is long and cannot realistically be brute-forced or guessed. Brute-forcing means trying every possible value until one works. A long random string has so many possible values that trying them all would take an impractical amount of time.
Following the network requests during a second upload revealed that a separate HTTP response returns a direct link to the file rather than to its preview:
http://s0.2mdn.net/ads/richmedia/studio/pv2/61580927/20201004040915088/xsspng.png
Again, piece by piece:
http://s0.2mdn.netis the same media domain./ads/richmedia/studio/pv2/is the path for direct files.61580927is the merchant ID.20201004040915088is the upload date and time.xsspng.pngis the file name.
Notice what is missing compared with the preview link: the long random key. This direct link is also accessible without authentication, and it can be constructed by an attacker. The first eight digits are the merchant ID, which can be enumerated from the studio application, and the remainder consists of the upload date and a short random number.
Enumerated means collected by walking through a range of values, for example reading merchant IDs off pages in the app. IDOR stands for Insecure Direct Object Reference: a situation where the server hands out an object (a file, a record, an order) based on an identifier supplied by the client, without checking that the client is allowed to have that object. The everyday comparison is a cloakroom that gives you ticket number 42 and then hands out whatever coat is behind hook 42 to anyone who asks for it, without checking the ticket.
That makes it a clear IDOR: a guessable link to another user's file, served without any authorisation check.
Google accepted this issue and paid a 500 USD bounty.
Step 2: campaigns of other accounts
The role management system allows an account to be created without access to the QA dashboard. The dashboards differ visibly between an administrator account and a limited account.
The first image shows the admin dashboard and the second the limited account dashboard. The point of showing both is that the interface clearly reflects the missing permission: the limited user is not offered the QA view.
With the limited account, requesting the QA page directly was expected to fail. It did not:
This image shows the result of requesting the QA page with the limited account.
The reasoning behind the step is worth spelling out. Hiding a button or a menu entry is a presentation choice made by the page in your browser. It is not a security control. If the server does not separately check your permission when the page is requested, then typing the address yourself, or following a link someone sends you, gets you in. This is why testers always try the direct URL after noticing a feature is hidden.
The limited user could reach the QA page not only for the campaigns its own account was associated with, but for all campaigns of all accounts. The behaviour looks like a fail-to-true bug: an account with permission to see nothing ends up seeing everything. In other words, the permission check was written in a way that, when it had no positive rule to apply, returned "allowed" instead of "denied". A safe default is the opposite: deny unless explicitly permitted.
Google issued a 5000 USD bounty for this one.
Step 3: GWT request identifiers
Richmedia Studio uses GWT for its APIs. GWT, the Google Web Toolkit, is a framework for building browser applications in Java. The browser code it produces talks to the server through a particular request format, and that format is not meant to be read by humans. It is a serialisation format: a way of packing a list of values into one string so the server can unpack it.
The file upload process was revisited with attention on the GWT requests, in particular the HTTP request that retrieves the file download URL (the long preview link seen earlier). Its POST body contained the following:
7|0|8|https://www.google.com/doubleclick/studio/gwt/|[redacted]|com.google.ads.api.gwt.rpc.client.BatchedInvocationService|invoke|com.google.ads.api.gwt.rpc.client.BatchedInvocationRequest/2983766987|com.google.ads.richmedia.studio.ui.common.grubby.client.BatchedInvocationRequestHeaderImpl/3117963532|java.util.ArrayList/4159755760|com.google.ads.richmedia.studio.service.CreativeServiceGwt$GetDownloadArchiveUrlRequest/1562479252|1|2|3|4|1|5|5|6|0|7|1|8|DlQXE|DlQWU|
A POST body is the part of an HTTP request that carries data to the server, as opposed to the URL, which carries the address. When you submit a form or the page sends data on your behalf, it usually goes in the body.
Reading the string from left to right:
- The values are separated by
|characters, so the whole thing is a list. 7|0|8|are numbers that describe the structure of the list: how many entries follow, and how they are laid out. They are bookkeeping for the parser, not data you care about.https://www.google.com/doubleclick/studio/gwt/is the base address of the GWT service.[redacted]is a long hex string, a strong identifier for the service or module.com.google.ads.api.gwt.rpc.client.BatchedInvocationServiceandinvokename the Java class and method being called. In plain words: "run this remote procedure".- The next several entries, such as
com.google.ads.api.gwt.rpc.client.BatchedInvocationRequest/2983766987andcom.google.ads.richmedia.studio.service.CreativeServiceGwt$GetDownloadArchiveUrlRequest/1562479252, are class names with a numeric suffix. The suffix is a version or hash the framework uses to match client and server code. 1|2|3|4|1|5|5|6|0|7|1|8|are small numbers that index into the list, telling the parser which earlier entry each argument refers to.DlQXEandDlQWUare the actual argument values at the end.
The GWT serialisation format is opaque at first sight, but the two strings at the end, DlQXE and DlQWU, stood out. Poking around the system showed that these strings are identifiers representing the specific campaign being accessed.
Why did they stand out? Because everything before them is long, structured and clearly generated by the framework, while these two are short and look like they were chosen by a person or a simple counter. Short, human-scale values are exactly the kind that can be guessed.
Logging in as a different user produced another pair of identifiers. Sending that pair with the first user's cookies returned the download URL for the second user's files. This is the classic test for an authorisation flaw: take a value that belongs to account B, send it while authenticated as account A, and see whether the server checks whose value it is. Here it did not.
Because the strings are very short, guessing them is practical: a quick script generating similar-looking identifiers quickly found more that worked, pointing to files belonging to other users. A script in this context is a short program that sends many requests automatically, each with a slightly different value, and reports which ones succeed.
This bug yielded another 500 USD bounty.
Steps 4 and 5
Further research into the authorisation mechanism produced more issues within a few days, and Google's team agreed that the authorisation in Richmedia Studio needed adjusting.
The report does not give further detail on these two findings.
Why it happened
Three distinct weaknesses are described.
- The media storage domain
s0.2mdn.netserves files without any authorisation check, and the direct link format is predictable: merchant ID, upload date and a short random number. - The QA dashboard relies on a permission check that fails open, so an account granted no visibility is granted full visibility.
- The GWT download request trusts short campaign identifiers supplied by the client without verifying that the caller is entitled to the campaign they name.
That is the common thread: the designers assumed nobody would guess the link or the code, instead of asking the server, on every request, "is this person allowed to have this?".
What an attacker could do
An attacker with a Richmedia Studio account could retrieve other users' uploaded media through guessable direct links, read the campaigns of all accounts through the QA page despite having no QA permission, and obtain download URLs for other users' files by guessing short campaign identifiers in GWT requests. The media links required no authentication at all, so the first issue extended beyond studio users to anyone holding or guessing a link.
What Google did
The report does not describe the specific code changes made.
Things to try yourself
These are the same checks, phrased as exercises. Each one names what a positive result looks like, so you know when you have found something.
- Upload a file in any application that serves media from a separate domain and inspect every response during the upload. A positive result is a second, shorter URL that resolves without cookies.
- Take the short URL format and vary the numeric and random components around your own values. A positive result is a file you did not upload.
- Create a role with no permissions on a dashboard or module and request that page directly. A positive result is the page rendering data rather than an error.
- Capture GWT POST bodies and look for short strings at the end of the serialised argument list. Swap them for values from a second account while keeping the first account's cookies. A positive result is a URL or object belonging to the second account.
- Generate similar-looking short identifiers with a script and replay them. A positive result is any identifier that returns another user's data.
- Check whether an application you cannot access still exists behind a URL, by requesting it with an account that lacks the feature. A positive result is any response other than a redirect away.
Glossary
- API: the set of server endpoints a web page calls behind the scenes to fetch or change data.
- Authentication: proving who you are, usually by logging in. Distinct from authorisation.
- Authorisation: deciding what an already identified user is allowed to do or see.
- Bounty: a payment a company makes to someone who reports a security flaw to it.
- Brute-forcing: trying every possible value until one works; impractical against long random strings.
- Cookie: a small piece of data a site asks your browser to store and send back on later requests to that same site, commonly used to keep you logged in.
- Direct link: here, the short file URL without the long preview key.
- Domain: the part of a URL that names the site, such as
s0.2mdn.net; cookies are tied to a domain. - Enumerate: collect values by walking through a range, for example reading IDs off pages.
- Fail open / fail to true: a check that returns "allowed" when it cannot decide, instead of "denied".
- GWT (Google Web Toolkit): a framework for writing browser applications in Java; it uses a compact serialisation format for requests.
- HTTP request / response: the message your browser sends to a server, and the message the server sends back.
- IDOR (Insecure Direct Object Reference): handing out an object based on an identifier from the client without checking the client may have it.
- Merchant ID: a numeric identifier for an account, visible in the application.
- Network tab: the browser developer tools panel that lists every request and response a page makes.
- Permission: a single yes/no rule, such as "may view the QA dashboard".
- POST body: the part of an HTTP request that carries data to the server.
- Preview link: the long file URL containing a long random key.
- QA (quality assurance): the review step a campaign goes through before going live; the QA dashboard is where that happens.
- Role: a named bundle of permissions assigned to a user.
- Script: a short program that automates sending many requests.
- Serialisation: packing a list of values into one string so it can be sent and unpacked later.
- Session: the server-side record of your logged-in state, referenced by a cookie.