$7.5k Google services mix-up
The Google Service Management API did not check that the service name and the name in the service configuration matched when creating a service with certain configVersion values. An attacker could create a service with a real name but a configuration claiming a different service, allowing them to enable or disable other services, access hidden capabilities, and potentially bypass authentication.
Published on web.archive.org
Before getting to the bug itself, I need to explain a few concepts. You can jump directly to it if you want.
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
Google Service Management is the service that sits behind the management of APIs on Google's systems. It covers Google's own public and internal APIs as well as services that users deploy with Google Cloud Endpoints. Through it, a user can enable or disable services on a Google Cloud Platform project, list the services available to them (Maps API, Gmail API, private APIs they have access to, and so on), and manage the settings of their own services through service configurations.
Developers rarely touch the service directly. They interact with it through the Google Cloud Console, through the command line for enabling and disabling services, or through Google Cloud Endpoints for managing settings. Underneath all of that there is an API, and that API does more than its public documentation describes. It also carries hidden capabilities that are only meant to be reachable by Google services that use the API.
Those hidden capabilities are gated by a feature called Visibility, which is documented externally but used only internally by Google. The same mechanism hides methods and parameters. A non-Google client that tries to reach a hidden method gets a 404, and the error comes back in JSON rather than the usual HTML page with the broken robot and the lines "That's an error." and "That's all we know." that an inexistent method would produce.
Finding hidden API capabilities or hidden documentation is not treated by Google as a security vulnerability. What is treated as a vulnerability is a hidden capability that, when used successfully, has a real security consequence, such as the usage.dependsOnServices field in an earlier bug.
Setup
The only precondition is a Google Cloud Platform project with the Service Management API enabled. The simplest way to enumerate the hidden surface is to enable the Service Management API on a project and open the combo box used for filtering the traffic the project produces. That combo box lists every method available through the API, including the hidden ones, which are framed in red and are not accessible to non-Google clients.
To forge requests as the Console, you need a logged-in Google user, because the authentication relies on the user's cookies. The cookies required are SID, HSID, SSID, APISID and SAPISID, and a Google user obtains them simply by logging in.
The Console calls several public and private Google APIs with its own client, and that client carries the API key [redacted]. A typical request from it looks like this:
GET /v1/services?key=[redacted] HTTP/1.1
Host: servicemanagement.clients6.google.com
Authorization: SAPISIDHASH <SAPISIDHASH>
X-Origin: https://console.cloud.google.com
Cookie: <GOOGLE COOKIES>
Each part matters:
servicemanagement.clients6.google.comis another way of sayinggoogleapis.com. Theclients6form is needed because the cookies can only reachgoogle.comsubdomains.SAPISIDHASHis a value in the formTIMESTAMP_HASH. Other ways of constructing it exist but are irrelevant here.- The
X-Originheader (or justOrigin) is needed both for the SAPISIDHASH and to verify that the call comes from an authorised client on a trusted website. - The cookies listed above are the ones a logged-in user supplies.
Forging a request with the Console client is easy, and because the client is Google-owned it has access to internal capabilities of several Google APIs, including some private Google APIs, and including the Service Management API.
Finding it
The hidden surface was not hard to reach. Looking at the HTTP requests the Google Cloud Console makes when visited was enough to see how the client authenticates and which host it uses. From there, the question was which of the hidden capabilities the Console client could exercise.
One of them is creating a service with a configuration attached from the beginning. Normal clients ignore the serviceConfig parameter because it is hidden, and create a service with no initial configuration. The Console client does not ignore it, and a request like the following creates a service with a configuration in one go:
POST /v1/services?key=[redacted] HTTP/1.1
Host: servicemanagement.clients6.google.com
Authorization: SAPISIDHASH <SAPISIDHASH>
X-Origin: https://console.cloud.google.com
Cookie: <GOOGLE COOKIES>
Content-Length: <CONTENT-LENGTH>
{
"serviceName": "<SERVICE NAME>",
"producerProjectId": "<PROJECT>",
"serviceConfig": {
"name": "<SERVICE NAME>",
"producerProjectId": "<PROJECT>",
"configVersion": 3
}
}
Normally serviceName and serviceConfig.name must match in any request where both are specified. During creation, that constraint was not checked when configVersion was set to 1, 2, or a value between 2147483648 and 4294967295, because an integer overflow occurs in the back-end. That meant any user could create a service with a real name, such as the-expanse.appspot.com, but with a configuration that claims it is a different service, such as my-private-secure-api.appspot.com.
The bug did not work for a few old Google services, which have a special setting for compatibility reasons.
Exploitation
The mismatch matters because several important processes use the name found in the configuration of a service when performing an action, except when checking permissions, where they use the service name itself. With a different name in the configuration, an attacker can be permitted to perform important actions on a different service.
Step 1: Enabling another service
If my service the-expanse.appspot.com carries very-important-api.example.com in its configuration, then enabling the-expanse.appspot.com for a project proceeds because I have permission to enable the-expanse.appspot.com. The action is really performed on very-important-api.example.com, so I end up having enabled very-important-api.example.com.
If a customer sets up an API to use Google API keys and/or Google Auth tokens to authenticate legitimate clients, this could be bypassed by an attacker. Google itself uses this method for authenticating legitimate clients, so an attacker could reach private Google APIs that are in development, are meant to be used only internally, or are accessible to a few white-listed users such as Trusted Testers or the Google My Business API.
Step 2: Getting access to hidden capabilities
A hidden method in the Service Management API is PatchProjectSettings. It lets a service owner set hidden settings of a specific service consumer (a project). Among those settings is the option for setting visibility labels, which manage access to hidden capabilities.
For instance, if I have my service the-expanse.appspot.com with cloudresourcemanager.googleapis.com in its configuration, I can send the following request and get access, on my project the-expanse, to capabilities being tested by a select few (Trusted Testers) in the Cloud Resource Manager API:
PATCH /v1/services/the-expanse.appspot.com/projectSettings/the-expanse?updateMask=visibilitySettings&key=[redacted] HTTP/1.1
<..SAME HEADERS AS BEFORE...>
{
"visibilitySettings": {
"visibilityLabels": [
"TRUSTED_TESTER"
]
}
}
The path names my service, the projectSettings segment names the consumer project, and updateMask=visibilitySettings selects the field being changed. The body sets the TRUSTED_TESTER visibility label on that project.
Step 3: Disabling the service on someone else's project
Using the same method, another setting controls whether a project has the service enabled or not. You cannot enable your service on a project you do not own, only disable it.
For instance, if I have my service the-expanse.appspot.com with cloudresourcemanager.googleapis.com in its configuration, I can send the following request and disable the Cloud Resource Manager API on Cloud SDK, which uses the project google.com:cloudsdktool:
PATCH /v1/services/the-expanse.appspot.com/projectSettings/google.com:cloudsdktool?updateMask=usageSettings&key=[redacted] HTTP/1.1
<..SAME HEADERS AS BEFORE...>
{
"usageSettings": {
"consumerEnableStatus": "DISABLED"
}
}
Here the path targets the google.com:cloudsdktool project and updateMask=usageSettings selects the usage setting, whose consumerEnableStatus is set to DISABLED.
Root cause
During creation, the constraint that serviceName and serviceConfig.name must match was not checked when configVersion was 1, 2, or a value between 2147483648 and 4294967295. The latter range points to an integer overflow in the back-end. Because the two names could diverge, downstream processes that trust the configuration name for the action and the service name for the permission check ended up acting on a service the caller was never authorised to touch. The Visibility mechanism hid the serviceConfig parameter and the PatchProjectSettings method from ordinary clients, but hiding them did not stop a client that could present itself as the Console from using them.
Impact
The author did not test most of the following scenarios and notes that some may never have been possible, but was very confident they could be done:
- Accessing several Google APIs in development to use features not yet released to the general public.
- Accessing billed Google APIs for free by enabling them through this bug, since the billing constraint is enforced using the real service name.
- Accessing private APIs developed by Google users using Google Cloud Endpoints.
- Accessing hidden features not yet released to the general public in public Google APIs.
- Bypassing quota limits, which are stored in the project settings too.
- Exploiting bugs not available without the use of this one.
- Disabling key APIs for some projects that lead to service outages, such as the Cloud SDK not being able to access projects or Android's YouTube app not being able to retrieve videos' metadata.
The demonstrated actions were enabling another service, granting hidden capabilities through visibility labels, and disabling a service on a project the attacker does not own.
Fix
The development team fixed the bug during creation on 2018-01-29. On 2018-01-30, all services with mismatched serviceName/serviceConfig.name pairs were completely purged from Google's systems, so the bug could no longer be exploited. The development team had independently discovered the bug and patched an emergency fix during the weekend.
Variants to test
- Try creating a service with a configuration attached through a Google-owned client and a mismatched
serviceConfig.name, cyclingconfigVersionthrough 1, 2 and values in the 2147483648 to 4294967295 range. A positive result is a created service whose configuration names a different service. - On a service you own, enable a service whose configuration names a target you do not control, then check whether the target becomes enabled for your project. A positive result is the target service appearing as enabled.
- Call the hidden
PatchProjectSettingsmethod withupdateMask=visibilitySettingsand aTRUSTED_TESTERlabel against a project you own, using a service whose configuration names a public API. A positive result is hidden capabilities of that API becoming reachable on your project. - Call
PatchProjectSettingswithupdateMask=usageSettingsandconsumerEnableStatusset toDISABLEDagainst a project you do not own, using a service whose configuration names a public API. A positive result is the target service being disabled for that project. - Check whether old Google services behave differently, since a few of them carry a special compatibility setting that made this bug not work.
Timeline (UTC-3)
| When | What |
|---|---|
| 2018-01-27 afternoon | Bug found |
| 2018-01-27, 06:45 PM | Initial submission |
| 2018-01-27, around 7:45 PM | Google Service Management API development team discovered the bug independently (on a Saturday) |
| 2018-01-29 | Bug during creation fixed by the development team |
| 2018-01-29, 12:53 PM | Bug report triaged |
| 2018-01-30 | All services with mismatched serviceName/serviceConfig.name pairs purged from Google's systems, so the bug could no longer be exploited |
| 2018-01-30, 06:46 PM | Security team cannot reproduce scenario #3, the security engineer keeps getting 401 errors |
| 2018-01-30, 08:21 PM | Confirmed that the development team discovered the hack and patched an emergency fix during the weekend |
| 2018-01-31, 12:42 PM | Told the development team independently discovered the bug an hour after the report; the report is sent to the security panel to check if a reward can be issued |
| 2018-02-14, 06:12 AM | A reward of 7500 dollars is issued |
What happened, in plain words
A security researcher found a way to make Google's own systems confuse one online service for another. Google runs a huge catalogue of services (APIs) that software can talk to, and it keeps a record for each one. That record has two names in it: the real name of the service, and a name written inside its settings file (its configuration). Normally those two names must be identical. The researcher found that when a service was being created, a particular number in the request could be set to certain values that made Google skip the check that the two names match. The result was a service that was really called one thing but whose settings claimed it was something else.
That mismatch is dangerous because different parts of Google's systems trust different names. When deciding whether you are allowed to do something, Google looks at the real name. When actually carrying out the action, it looks at the name inside the settings. So a person could be allowed to act on their own harmless service, and the action would land on a completely different, important service they were never allowed to touch. With that, the researcher showed it was possible to switch on services you should not be able to switch on, to unlock hidden features reserved for a small group of testers, and to switch off a service on a project belonging to someone else.
Google's own development team had found the same problem independently, on a Saturday. The researcher was later told they discovered it an hour after his report. The creation bug was fixed on 2018-01-29, all services with mismatched names were purged on 2018-01-30, and a reward of 7,500 US dollars was later issued.
Before the details, a few ideas need explaining, because the whole bug lives inside them.
Key concepts
What an API is
An API (Application Programming Interface) is a way for one piece of software to ask another piece of software to do something. A simple comparison: a restaurant. You do not walk into the kitchen and cook; you read the menu, tell the waiter what you want, and food comes back. The menu and the waiter are the API. The kitchen is the service. You only need to know the menu, not how the kitchen works.
When you use a website or an app, your browser or phone is constantly sending these requests to servers and getting answers back. Each request goes to a particular address (a URL) and asks for a particular action.
What Google Service Management is
Google has a service called Google Service Management. It is the thing that sits behind the management of APIs on Google's systems. It covers Google's own public and internal APIs, and also services that users deploy themselves with Google Cloud Endpoints.
Through it, a user can:
- enable or disable services on a Google Cloud Platform project;
- list the services available to them (Maps API, Gmail API, private APIs they have access to, and so on);
- manage the settings of their own services through service configurations.
A project here is simply a container that groups together a person's or a company's use of Google Cloud, with its own settings and permissions. Think of it as a folder with a keycard attached.
A service configuration is the settings file for a service: a document describing how that service should behave.
Developers rarely touch Service Management directly. They interact with it through the Google Cloud Console (the web page where you click buttons), through the command line (typing commands instead of clicking), or through Google Cloud Endpoints (for managing settings). Underneath all of that there is an API, and that API does more than its public documentation describes. It also carries hidden capabilities that are only meant to be reachable by Google's own services that use the API.
What Visibility is
Those hidden capabilities are gated by a feature called Visibility. Visibility is documented externally but used only internally by Google. The same mechanism hides both methods and parameters.
A method is one specific action an API offers, like a button on the menu: "list services", "create service", "delete service". A parameter is one piece of information you send with the request, like "which project" or "which name".
If a non-Google client tries to reach a hidden method, it gets a 404. A 404 is the standard "not found" answer a web server gives when the address does not exist. Here the 404 comes back in JSON rather than the usual HTML page with the broken robot and the lines "That's an error." and "That's all we know." that an inexistent method would produce. JSON is a plain text format for structured data, made of names and values in curly braces; HTML is the language web pages are written in.
One important note from the researcher: finding hidden API capabilities or hidden documentation is not treated by Google as a security vulnerability. What is treated as a vulnerability is a hidden capability that, when used successfully, has a real security consequence, such as the usage.dependsOnServices field in an earlier bug.
Setup
The only precondition is a Google Cloud Platform project with the Service Management API enabled. The simplest way to see the hidden surface is to enable the Service Management API on a project and open the combo box used for filtering the traffic the project produces. A combo box is the drop-down list you click to pick an option.
That combo box lists every method available through the API, including the hidden ones, which are framed in red and are not accessible to non-Google clients.
Cookies and tokens, from zero
To forge requests as the Console, you need a logged-in Google user, because the authentication relies on the user's cookies.
A cookie is a small piece of text that a website stores in your browser after you log in, and that your browser sends back with every later request to that site. It is how the site recognises you: like a wristband you get at an event, which the staff check at every door instead of asking for your ID again.
A token is similar in spirit: a value that proves who you are or what you are allowed to do, usually generated for a request rather than stored long term.
The cookies required here are SID, HSID, SSID, APISID and SAPISID, and a Google user obtains them simply by logging in.
The Console calls several public and private Google APIs with its own client, and that client carries the API key [redacted]. An API key is a short string that identifies which application is making the call, a bit like a name badge on a visitor. A typical request from it looks like this:
GET /v1/services?key=[redacted] HTTP/1.1
Host: servicemanagement.clients6.google.com
Authorization: SAPISIDHASH <SAPISIDHASH>
X-Origin: https://console.cloud.google.com
Cookie: <GOOGLE COOKIES>
Line by line:
GET /v1/services?key=...is the request line.GETmeans "give me something"./v1/servicesis the address of the action (list the services). Everything after the?is extra information, here the API key.Host: servicemanagement.clients6.google.comsays which server the request is addressed to.Authorization: SAPISIDHASH <SAPISIDHASH>is the proof of identity.SAPISIDHASHis a value in the formTIMESTAMP_HASH. Other ways of constructing it exist but are irrelevant here.X-Origin: https://console.cloud.google.comsays which website the request is coming from. TheX-Originheader (or justOrigin) is needed both for the SAPISIDHASH and to verify that the call comes from an authorised client on a trusted website.Cookie: <GOOGLE COOKIES>carries the cookies listed above, which a logged-in user supplies.
Two details about the host name are worth spelling out. servicemanagement.clients6.google.com is another way of saying googleapis.com. The clients6 form is needed because the cookies can only reach google.com subdomains. A subdomain is a name that sits under a larger name: in mail.example.com, mail is the subdomain of example.com.
Forging a request with the Console client is easy, and because the client is Google-owned it has access to internal capabilities of several Google APIs, including some private Google APIs, and including the Service Management API. Forging a request with the Console client is easy, and because the client is Google-owned it has access to internal capabilities of several Google APIs.
Finding it
The hidden surface was not hard to reach. Looking at the HTTP requests the Google Cloud Console makes when visited was enough to see how the client authenticates and which host it uses. HTTP is the language browsers and servers use to exchange requests and answers; you can see these exchanges in your browser's developer tools, under the Network tab.
From there, the question was which of the hidden capabilities the Console client could exercise. One of them is creating a service with a configuration attached from the beginning. Normal clients ignore the serviceConfig parameter because it is hidden, and create a service with no initial configuration. The Console client does not ignore it, and a request like the following creates a service with a configuration in one go:
POST /v1/services?key=[redacted] HTTP/1.1
Host: servicemanagement.clients6.google.com
Authorization: SAPISIDHASH <SAPISIDHASH>
X-Origin: https://console.cloud.google.com
Cookie: <GOOGLE COOKIES>
Content-Length: <CONTENT-LENGTH>
{
"serviceName": "<SERVICE NAME>",
"producerProjectId": "<PROJECT>",
"serviceConfig": {
"name": "<SERVICE NAME>",
"producerProjectId": "<PROJECT>",
"configVersion": 3
}
}
Line by line:
POST /v1/services?key=...is the request line.POSTmeans "create something new". The address is the same list of services, but a POST to it creates an entry.Host,Authorization,X-OriginandCookieare the same identity and origin headers as before.Content-Length: <CONTENT-LENGTH>tells the server how many bytes of body follow, so it knows where the body ends.- The blank line separates the headers from the body.
- The body is JSON.
serviceNameis the real name of the service being created.producerProjectIdis the project that owns it. serviceConfigis the settings file attached at creation time. Inside it,nameis the name written in the settings,producerProjectIdrepeats the owning project, andconfigVersionis a version number for the settings format.
Normally serviceName and serviceConfig.name must match in any request where both are specified. During creation, that constraint was not checked when configVersion was set to 1, 2, or a value between 2147483648 and 4294967295, because an integer overflow occurs in the back-end.
An integer overflow is what happens when a computer tries to store a number that is too big for the fixed-size box it uses. The number wraps around, like a car odometer rolling from 999999 to 000000. The back-end code took a different path for those wrapped values and skipped the name check.
That meant any user could create a service with a real name, such as the-expanse.appspot.com, but with a configuration that claims it is a different service, such as my-private-secure-api.appspot.com.
The bug did not work for a few old Google services, which have a special setting for compatibility reasons. Compatibility here means keeping old behaviour working for services that were built before a rule existed.
Exploitation
The mismatch matters because several important processes use the name found in the configuration of a service when performing an action, except when checking permissions, where they use the service name itself. With a different name in the configuration, an attacker can be permitted to perform important actions on a different service.
A useful comparison: imagine a building where the security guard checks the name on your badge (the real service name) and lets you in, but the lift inside reads the destination written on a sticky note in your pocket (the configuration name) and takes you there. You were cleared for the badge, but you travel to the sticky note's floor.
Step 1: Enabling another service
If my service the-expanse.appspot.com carries very-important-api.example.com in its configuration, then enabling the-expanse.appspot.com for a project proceeds because I have permission to enable the-expanse.appspot.com. The action is really performed on very-important-api.example.com, so I end up having enabled very-important-api.example.com.
Why this matters: if a customer sets up an API to use Google API keys and/or Google Auth tokens to authenticate legitimate clients, this could be bypassed by an attacker. Google itself uses this method for authenticating legitimate clients, so an attacker could reach private Google APIs that are in development, are meant to be used only internally, or are accessible to a few white-listed users such as Trusted Testers or the Google My Business API.
White-listed means on an approved list: only the named accounts are allowed in. Trusted Testers is the name of such a group at Google.
Step 2: Getting access to hidden capabilities
A hidden method in the Service Management API is PatchProjectSettings. It lets a service owner set hidden settings of a specific service consumer (a project). Among those settings is the option for setting visibility labels, which manage access to hidden capabilities. A label here is just a tag, a word attached to a project that unlocks things.
For instance, if I have my service the-expanse.appspot.com with cloudresourcemanager.googleapis.com in its configuration, I can send the following request and get access, on my project the-expanse, to capabilities being tested by a select few (Trusted Testers) in the Cloud Resource Manager API:
PATCH /v1/services/the-expanse.appspot.com/projectSettings/the-expanse?updateMask=visibilitySettings&key=[redacted] HTTP/1.1
<..SAME HEADERS AS BEFORE...>
{
"visibilitySettings": {
"visibilityLabels": [
"TRUSTED_TESTER"
]
}
}
Line by line:
PATCHmeans "change part of an existing thing". The address has three parts:services/the-expanse.appspot.comnames my service,projectSettings/the-expansenames the consumer project whose settings are being changed, andupdateMask=visibilitySettingsselects which field is being changed. A mask here is just a way of saying "only touch this field".- The
keyis the Console's API key, as before. <..SAME HEADERS AS BEFORE...>stands for the identity and origin headers already shown.- The body sets the
TRUSTED_TESTERvisibility label on that project. The square brackets mean a list, here a list with one label in it.
Step 3: Disabling the service on someone else's project
Using the same method, another setting controls whether a project has the service enabled or not. You cannot enable your service on a project you do not own, only disable it.
For instance, if I have my service the-expanse.appspot.com with cloudresourcemanager.googleapis.com in its configuration, I can send the following request and disable the Cloud Resource Manager API on Cloud SDK, which uses the project google.com:cloudsdktool:
PATCH /v1/services/the-expanse.appspot.com/projectSettings/google.com:cloudsdktool?updateMask=usageSettings&key=[redacted] HTTP/1.1
<..SAME HEADERS AS BEFORE...>
{
"usageSettings": {
"consumerEnableStatus": "DISABLED"
}
}
Line by line:
- The path still names my service,
the-expanse.appspot.com, but theprojectSettingssegment now namesgoogle.com:cloudsdktool, a project I do not own. updateMask=usageSettingsselects the usage setting, the one that says whether the service is on or off for that project.- The body sets
consumerEnableStatustoDISABLED, which switches the service off for that project.
Cloud SDK is Google's set of command-line tools for developers. The author listed the Cloud SDK not being able to access projects as a possible, untested consequence.
Root cause
The creation path validated that serviceName and serviceConfig.name matched, but the check was skipped when configVersion was 1, 2, or a value between 2147483648 and 4294967295. The latter range points to an integer overflow in the back-end. Because the two names could diverge, downstream processes that trust the configuration name for the action and the service name for the permission check ended up acting on a service the caller was never authorised to touch. The Visibility mechanism hid the serviceConfig parameter and the PatchProjectSettings method from ordinary clients, but hiding them did not stop a client that could present itself as the Console from using them.
Impact
The author did not test most of the following scenarios and notes that some may never have been possible, but was very confident they could be done:
- Accessing several Google APIs in development to use features not yet released to the general public.
- Accessing billed Google APIs for free by enabling them through this bug, since the billing constraint is enforced using the real service name.
- Accessing private APIs developed by Google users using Google Cloud Endpoints.
- Accessing hidden features not yet released to the general public in public Google APIs.
- Bypassing quota limits, which are stored in the project settings too. A quota is a cap on how much of a service you may use, for example a number of requests per day.
- Exploiting bugs not available without the use of this one.
- Disabling key APIs for some projects that lead to service outages, such as the Cloud SDK not being able to access projects or Android's YouTube app not being able to retrieve videos' metadata.
The demonstrated actions were enabling another service, granting hidden capabilities through visibility labels, and disabling a service on a project the attacker does not own.
Fix
The development team fixed the bug during creation on 2018-01-29. On 2018-01-30, all services with mismatched serviceName/serviceConfig.name pairs were completely purged from Google's systems, so the bug could no longer be exploited. The development team had independently discovered the bug and patched an emergency fix during the weekend.
Variants to test
These are the checks a researcher would repeat to confirm the behaviour, written as things to try:
- Try creating a service with a configuration attached through a Google-owned client and a mismatched
serviceConfig.name, cyclingconfigVersionthrough 1, 2 and values in the 2147483648 to 4294967295 range. A positive result is a created service whose configuration names a different service. - On a service you own, enable a service whose configuration names a target you do not control, then check whether the target becomes enabled for your project. A positive result is the target service appearing as enabled.
- Call the hidden
PatchProjectSettingsmethod withupdateMask=visibilitySettingsand aTRUSTED_TESTERlabel against a project you own, using a service whose configuration names a public API. A positive result is hidden capabilities of that API becoming reachable on your project. - Call
PatchProjectSettingswithupdateMask=usageSettingsandconsumerEnableStatusset toDISABLEDagainst a project you do not own, using a service whose configuration names a public API. A positive result is the target service being disabled for that project. - Check whether old Google services behave differently, since a few of them carry a special compatibility setting that made this bug not work.
Timeline (UTC-3)
| When | What |
|---|---|
| 2018-01-27 afternoon | Bug found |
| 2018-01-27, 06:45 PM | Initial submission |
| 2018-01-27, around 7:45 PM | Google Service Management API development team discovered the bug independently (on a Saturday) |
| 2018-01-29 | Bug during creation fixed by the development team |
| 2018-01-29, 12:53 PM | Bug report triaged |
| 2018-01-30 | All services with mismatched serviceName/serviceConfig.name pairs purged from Google's systems, so the bug could no longer be exploited |
| 2018-01-30, 06:46 PM | Security team cannot reproduce scenario #3, the security engineer keeps getting 401 errors |
| 2018-01-30, 08:21 PM | Confirmed that the development team discovered the hack and patched an emergency fix during the weekend |
| 2018-01-31, 12:42 PM | Told the development team independently discovered the bug an hour after the report; the report is sent to the security panel to check if a reward can be issued |
| 2018-02-14, 06:12 AM | A reward of 7500 dollars is issued |
A 401 error is the standard "you are not authenticated" answer: the server did not accept the identity being presented.
Glossary
- API: a defined way for one piece of software to ask another to do something, like a menu and a waiter in a restaurant.
- API key: a short string that identifies which application is making a request.
- Back-end: the servers and code behind a website or service, which users do not see directly.
- Combo box: a drop-down list in a web page from which you pick one option.
- Compatibility setting: a special configuration kept so that older services continue to work as before.
- Configuration (service configuration): the settings file describing how a service should behave.
- Cookie: a small piece of text stored by a website in your browser after login and sent back with later requests, so the site recognises you.
- GET: an HTTP request that asks to read something.
- Header: a line of extra information attached to an HTTP request or response, such as identity or origin.
- HTML: the language web pages are written in.
- HTTP: the language browsers and servers use to exchange requests and answers.
- Integer overflow: what happens when a number is too large for the fixed-size box used to store it, so it wraps around to a different value.
- JSON: a plain text format for structured data, made of names and values in curly braces.
- Label (visibility label): a tag attached to a project that unlocks hidden capabilities.
- Method: one specific action an API offers, such as list, create or delete.
- Parameter: one piece of information sent with a request, such as a name or a project.
- PATCH: an HTTP request that changes part of an existing thing.
- POST: an HTTP request that creates something new.
- Project: a container in Google Cloud that groups a user's or company's use of services, with its own settings and permissions.
- Quota: a cap on how much of a service may be used, for example requests per day.
- SAPISIDHASH: a value in the form
TIMESTAMP_HASHused to prove identity in requests to Google APIs. - Service Management: Google's service for managing APIs: enabling and disabling them, listing them, and managing their settings.
- Subdomain: a name that sits under a larger name, such as
mailinmail.example.com. - Token: a value that proves who you are or what you are allowed to do, usually generated for a request.
- Trusted Testers: a group of approved users who get early access to features being tested.
- Visibility: Google's internal mechanism for hiding methods and parameters from clients that are not Google's own.
- White-listed: on an approved list, so only the named accounts are allowed in.
- 401 error: the standard "you are not authenticated" answer from a server.
- 404 error: the standard "not found" answer from a server when the address does not exist.