Skip to content
Access control Write-up Beginner

Restriction is not a promise : Privilege escalation on Google.

A viewer of a Google Data Studio report could still create a copy of the report even when the owner had enabled the setting to disable downloading, printing and copying for viewers. The server did not validate the copy request against that restriction, so a viewer could bypass the owner's intended control.

Hariharan.s Follow

Published on medium.com

Bounty$500 View original

Hariharan.s

Hariharan.s, on medium.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. 3 min read.

Context

Google Data Studio is a dashboard and reporting tool that is easy to use, customise and share. It lets you turn data into reports for an audience. The feature at the centre of this write-up is report sharing, which offers separate settings for editors and viewers.

From the original on medium.com

One of those settings is Disable downloading, printing and copying for viewers. The researcher read the documentation on how this restriction behaves before testing it.

Setup

The researcher created a report of their own and captured the request that the viewer-side copy option generates. Testing was done from the viewer side, with the restriction toggled on and off, and the captured request replayed. No specific tooling, versions or accounts beyond the editor and viewer roles are described.

Finding it

While doing recon on how the site and its functions work, the report sharing feature caught the researcher's eye because it had two options.

Sharing options for editors and viewers

The behaviour of the restriction depends on whether Disable downloading, printing and copying for viewers is turned on:

  1. When the restriction is not turned on, the viewer side shows an option to create a copy of the report. When a viewer clicks it, a request is sent to create the copy.

Option to create a copy

  1. When the restriction is turned on, the option to create a copy is disabled on the viewer side, so no request is sent.

No option to create a copy

When the restriction is on, the option to create a copy is disabled on the viewer side, so no request is sent. That raised the question of what happens if the request is sent anyway while the restriction is on.

Exploitation

Step 1: capture the copy request

The researcher created a report and captured the request generated by the Create a copy of the report option. The request was:

Text
POST u/0/copyReport/Report ID

It is a POST to a copyReport path under the user's u/0 context, with the identifier of the report in the path.

Step 2: turn on the restriction

The researcher then turned on Disable downloading, printing and copying for viewers for that report. At this point the viewer side no longer offers the copy option.

Step 3: replay the request as a viewer

The same request was replayed on the viewer side. A copy of the report was created for the viewer.

Root cause

There was no validation on the server side for that request. The restriction was reflected only in the viewer interface, by disabling the copy option so that no request is sent. The report does not describe any further server-side check that should have caught the replay.

Impact

In the test, a copy of the report was created for the viewer even though the restriction was on. The report does not discuss other consequences of holding a copy, such as further redistribution.

Fix

Google fixed the issue. The report gives the timeline but does not describe the code change:

Date Event
Feb 5, 2020 Issue reported to Google
Feb 7, 2020 Triaged as P2
Feb 10, 2020 Nice catch
Feb 20, 2020 Accepted, then fixed
Feb 26, 2020 Reward of $500 issued and added to the hall of fame

Bounty :)

Variants to test

  1. Any feature whose restriction is implemented by hiding or disabling a control in the UI: capture the request the control would send, enable the restriction, and replay the request as the restricted role. A positive result is the server performing the action anyway.
  2. Copy, export, download and print actions on shared documents: replay the corresponding request while the owner has disabled that action for viewers. A positive result is a copy or export being produced for the restricted viewer.

Happy hunting.

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

What happened, in plain words

Google Data Studio is a free tool from Google for building dashboards and reports. You connect it to data, arrange charts and tables on a page, and share the result with other people. Think of it as a slide deck that pulls its numbers live from a spreadsheet or database.

When you share a report, you choose what each person is allowed to do. Some people are editors and can change the report. Others are viewers and can only look at it. There is also a switch called Disable downloading, printing and copying for viewers. When the owner turns it on, viewers are not supposed to be able to take a copy of the report away with them.

The researcher found that when the switch was on, the copy option was disabled on the viewer side, but replaying the copy request still created a copy. The button to make a copy disappeared, but the server behind the scenes would still make the copy if it was asked directly. A copy of the report was created for the viewer even though the restriction was on.

This is a beginner's walkthrough of the same finding. Every concept is explained from zero, and the one request involved is shown exactly as it appeared.

The product and the feature

Google Data Studio is a dashboard and reporting tool that is easy to use, customise and share. It lets you turn data into reports for an audience.

The feature at the centre of this write-up is report sharing. Sharing offers separate settings for editors and viewers.

From the original on medium.com

One of those settings is Disable downloading, printing and copying for viewers. Before testing, the researcher read the documentation on how this restriction is supposed to behave. Reading the documentation first is a habit worth copying: it tells you what the product promises, and a promise is exactly what you can test.

A quick word on the two roles, because they matter for the whole story:

  • An editor can change the report: add charts, change the data, alter the layout.
  • A viewer can only look at it. The owner decides what a viewer may do, and the restriction switch is one of those decisions.

Setting up the test

The researcher created a report of their own and captured the request that the viewer-side copy option generates. They then captured the request that the viewer-side copy option generates. Testing was done from the viewer side, with the restriction switched on and off, and the captured request replayed.

Two ideas to unpack here.

What is a request? When you click something in a browser, the browser sends a message to a server asking it to do something, and the server sends a message back. That pair of messages is a request and a response. A useful comparison is ordering food: you tell the waiter what you want (the request), the kitchen prepares it, and the waiter brings it back (the response). The browser is the waiter, the server is the kitchen.

What does "capture" and "replay" mean? Browsers have a developer tools panel, usually opened with F12, with a Network tab that lists every request the page makes. Capturing means writing down one of those requests so you can look at it. Replaying means sending the very same request again, by hand, without clicking the button. This matters because clicking a button and sending a request are two different things: the button is just a convenient way to trigger the request. If you can send the request yourself, you do not need the button at all.

No specific tooling, versions or accounts beyond the editor and viewer roles are described in the report.

Finding it

While doing recon on how the site and its functions work, the report sharing feature caught the researcher's eye because it had two options.

Sharing options for editors and viewers

"Recon", short for reconnaissance, just means looking around a product to understand what it does before you start poking at it. It is the same as walking around a building to see where the doors are before trying any of them.

The behaviour of the restriction depends on whether Disable downloading, printing and copying for viewers is turned on:

  1. When the restriction is not turned on, the viewer side shows an option to create a copy of the report. When a viewer clicks it, a request is sent to create the copy.

Option to create a copy

  1. When the restriction is turned on, the option to create a copy is disabled on the viewer side, so no request is sent.

No option to create a copy

The researcher's observation was that the restriction is enforced by removing the option in the interface. That raised the question of what happens if the request is sent anyway while the restriction is on.

This is the key insight of the whole write-up, so it is worth slowing down. There are two places a rule can be enforced:

  • On the client, meaning in your browser. The page hides or greys out a button so you cannot click it.
  • On the server, meaning in the machine that holds the data. The server checks who is asking and what they are allowed to do before acting.

A rule enforced only on the client is like a shop that puts up a sign saying "do not enter" but leaves the door unlocked. Anyone who ignores the sign walks straight in. A rule enforced on the server is like a locked door: the sign does not matter because the lock does the work.

Exploitation

Step 1: capture the copy request

The researcher created a report and captured the request generated by the Create a copy of the report option. The request was:

Text
POST u/0/copyReport/Report ID

Line by line, in plain words:

  • POST is the type of request. Requests come in kinds, called methods. GET means "give me this page or file". POST means "here is some information, do something with it". Making a copy is an action that changes things on the server, so it is a POST.
  • u/0 is a path segment that identifies the user context the request is made under. You can read it as "this request belongs to this user's space".
  • copyReport is the name of the action being asked for. The path literally says what it does: copy a report.
  • Report ID is a placeholder for the unique identifier of the report. Every report has its own identifier, a string the server uses to tell one report from another. The report shows it as a placeholder rather than a real value.

So the whole line reads: "please make a copy of the report with this identifier, for the user in this context".

Step 2: turn on the restriction

The researcher then turned on Disable downloading, printing and copying for viewers for that report. At this point the viewer side no longer offers the copy option.

This step is what makes the test meaningful. Without the restriction, a copy being created proves nothing, because that is the normal behaviour. With the restriction on, a copy being created would prove the restriction is not really enforced.

Step 3: replay the request as a viewer

The same request was replayed on the viewer side. A copy of the report was created for the viewer.

In other words: the button was gone, but the request still worked. There was no validation on the server side for that request. The option to create a copy was disabled on the viewer side, but there was no validation on the server side for that request.

Why it worked

The restriction was reflected only in the viewer interface, by disabling the copy option so that no request is sent.

A comparison: a hotel might tell guests at check-in that the minibar is locked, and indeed the key does not open it. But if the minibar door is not actually locked and only the key was changed, any guest who tries the handle gets in. The rule was announced, not enforced.

The report does not describe any further server-side check that should have caught the replay.

Impact

In the test, a copy of the report was created for the viewer even though the restriction was on.

If a viewer can copy it anyway, the owner's decision is not respected. The report does not discuss other consequences of holding a copy, such as further redistribution.

The fix and the timeline

Google fixed the issue. The report gives the timeline but does not describe the code change.

Date Event
Feb 5, 2020 Issue reported to Google
Feb 7, 2020 Triaged as P2
Feb 10, 2020 Nice catch
Feb 20, 2020 Accepted, then fixed
Feb 26, 2020 Reward of $500 issued and added to the hall of fame

Bounty :)

A few of those words may be new. Triaged means the security team looked at the report and sorted it by priority. P2 is a priority label, with lower numbers generally meaning more urgent. Accepted means the team agreed it was a real security issue. A bounty is the money a company pays a researcher for reporting a valid issue, and a hall of fame is a public list of researchers who have reported issues.

What to take away

  1. Any feature whose restriction is implemented by hiding or disabling a control in the interface is worth testing: capture the request the control would send, enable the restriction, and replay the request as the restricted role. A positive result is the server performing the action anyway.
  2. Copy, export, download and print actions on shared documents are good candidates: replay the corresponding request while the owner has disabled that action for viewers. A positive result is a copy or export being produced for the restricted viewer.

Happy hunting.

Glossary

  • API: the set of requests a service accepts, and the rules for sending them. It is how one program asks another to do something.
  • Authorisation: deciding whether a user is allowed to perform a particular action, as opposed to authentication, which is deciding who the user is.
  • Bounty: money paid by a company to a researcher who reports a valid security issue.
  • Broken authorisation: a flaw where the server does not properly check whether a user is allowed to do something.
  • Client: the program on your side, usually the browser, that sends requests and displays results.
  • Client-side enforcement: a rule enforced only in the browser, for example by hiding a button. It can be bypassed by sending the request directly.
  • Cookie: a small piece of data a site stores in your browser so it can recognise you on later requests. It often carries a session identifier.
  • Developer tools: the built-in panel in browsers, usually opened with F12, with a Network tab that lists requests and responses.
  • Editor: a user role that can change a report.
  • GET: a request method meaning "give me this page or file".
  • Hall of fame: a public list of researchers who have reported security issues to a company.
  • Identifier (ID): a unique value that tells one object, such as a report, apart from another.
  • Impact: the practical harm a security issue can cause.
  • P2: a priority label used by a security team, with lower numbers generally meaning more urgent.
  • POST: a request method meaning "here is some information, do something with it".
  • Privilege escalation: a situation where a user gains a capability they were not meant to have, such as a viewer doing something only an editor or owner should be able to do.
  • Recon: reconnaissance, looking around a product to understand how it works before testing it.
  • Replay: sending a previously captured request again, by hand, without using the interface that originally sent it.
  • Request: a message a client sends to a server asking it to do something.
  • Response: the message a server sends back after a request.
  • Root cause: the underlying reason a vulnerability exists, as opposed to its visible symptom.
  • Server: the machine that holds the data and decides what to do with each request.
  • Server-side validation: a check performed on the server, which the user cannot bypass by changing what their browser does.
  • Session: the period during which a site remembers who you are, usually tracked with a cookie or token.
  • Token: a value, often a long string, that proves to the server who you are or what you are allowed to do. It should be kept secret.
  • Triaged: reviewed and sorted by priority by a security team.
  • UI (user interface): the buttons, menus and screens you see and interact with.
  • Validation: checking that a request is acceptable before acting on it.
  • Viewer: a user role that can only look at a report, not change it.
  • Vulnerability: a weakness in a product that allows someone to do something they should not be able to do.

More by Hariharan.s

View all

3 more disclosed reports, 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.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.