$3133.70 Google Dialogflow IDOR Vulnerability
A test case deletion endpoint in Google Dialogflow did not verify that the requesting user owned the agent referenced in the request, so an attacker could delete test cases belonging to another user's agent by swapping the agent identifier. The attacker could obtain victim agent identifiers from public web demo links or embedded JavaScript.
Published on asterfiester.medium.com
AsterFiester
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
Dialogflow is Google's platform for building conversational agents. The report covers two versions of the product: Dialogflow Essentials and Dialogflow CX, with CX described as an upgraded version of Essentials with more features. An agent is, in the author's words, "just like a project to create everything".
The feature at the centre of the finding is Test Cases, which lives inside an agent. The author found it while looking for broken access control issues, having previously reported another IDOR in the same product.
Setup
The researcher tested manually rather than with automated tooling, on the grounds that automated tools are a poor fit for changing methods, adding custom headers and similar adjustments. Burp Suite was used as an intercepting proxy, and Burp Comparer was used to diff two requests. Two accounts were needed: an attacker account and a victim account. No versions or specific endpoints beyond the request body shown below are given in the report.
Finding it
While testing the application the author noticed the Test Cases option.

The Test Cases list was empty, and an attempt to import test cases did not work. Searching for information about the feature turned up nothing useful, so the author read the documentation and found the prebuilt agent feature. A prebuilt agent is a ready-made agent, and the author imported the same one into a second account.

Several prebuilt agents were available; the author picked the first one.

After creating the prebuilt agent, the Test Cases section was populated.


With test cases now present, the author selected one and clicked Delete.

Exploitation
Step 1: capture the delete request
With the interceptor on, the delete request body looked like this:
{“names”:[“projects/agent-nameas-nqsq/locations/us-central1/agents/3fbab09c-d034–4f35-bb1f-1ab0837e8806/testCases/9a1c14e8–3dee-43a6–8e58–10d4a1fb8a70”]}
The body carries a names array. Each entry is a resource path containing two identifiers: the agent id (3fbab09c-d034–4f35-bb1f-1ab0837e8806) and the test case id (9a1c14e8–3dee-43a6–8e58–10d4a1fb8a70). Both are UUIDs, which the author judged hard to guess and impractical to brute force, and initially treated as a dead end.

Step 2: reproduce the same test case in a second account
The idea was to create the same prebuilt agent in a victim account. A second account was registered, the same prebuilt agent was imported, and testing continued from there.

Step 3: compare the two delete requests
In the victim account the same test case was deleted and the request intercepted. The test case id was identical to the one in the attacker account. Both requests were sent to Burp Comparer. The main difference between the two requests was the agent id in the path:
agents/3fbab09c-d034–4f35-bb1f-1ab0837e8806
Step 4: swap the agent id
Replacing the attacker's agent id with the victim's agent id in the request deleted the test case in the victim account. The author notes that the agent id is still not guessable and cannot realistically be brute forced, so the primitive on its own is limited.

Step 5: obtain the agent id
Search engine dorking did not produce a way to collect agent ids, so the author went back into Dialogflow Essentials looking for one. The answer was the integration path: to embed an agent in a website you paste a JavaScript snippet, and the agent id is part of it.

Alternatively, the agent link can be shared by enabling the web demo, for example:
https://bot.dialogflow.com/be29c5bc-b4b7-4d24-b5ba-ec3d3cbe4ba1
That link is the main way to obtain an agent id, and the author also suggests trying different combinations of agent ids.
Step 6: bulk deletion
The author describes the impact as being able to select all test cases and delete them with one click by changing the agent id.
The issue was reported and rewarded $3133.70.
Root cause
The report does not describe the server-side check that was missing; the behaviour is consistent with the agent id in the path being trusted without an ownership check. In the author's test, importing the same prebuilt agent into a second account produced the same test case id, so only the agent id had to be discovered. The report does not describe the server-side check that was missing, so the exact mechanism is likely a missing ownership check on the parent agent.
Impact
An attacker who knows a victim's agent id can delete that agent's test cases; the author describes selecting all test cases and deleting them with one click by changing the agent id. The author is explicit about the limits: the agent id is not guessable and cannot be brute forced, so the attack depends on obtaining it from a public integration snippet or a shared web demo link.
Fix
The report records that the issue was fixed on Jul 5, 2021, but does not say what changed. A server-side ownership check tying the test case to an agent the caller can access would address the behaviour described.
Timeline
| Date | Event |
|---|---|
| May 27, 2021 12:50AM | Reported |
| May 27, 2021 04:15AM | Assigned |
| May 27, 2021 06:45PM | Accepted |
| Jun 17, 2021 12:20PM | Rewarded $3133.70 |
| Jul 5, 2021 08:45AM | Fixed |
Variants to test
- Template-derived identifiers. Create the same prebuilt agent or project template in two accounts and compare object ids. A positive result is an identical child object id across tenants, which removes the guessing barrier for that id.
- Parent id swap in batch endpoints. Take any request whose body is a list of resource names and replace the parent id with one from a second account. A positive result is a 200 response and the object disappearing from the victim account.
- Agent id discovery. Check public integration snippets, web demo links and any other embeddable configuration for the agent id. A positive result is an id that maps to a live agent you do not own.
- Sibling methods. Repeat the swap on read, update and export operations on the same resource, not only delete. A positive result is data from the victim account returned to the attacker.
- Cross-version parity. Test the same feature in both Dialogflow Essentials and Dialogflow CX. A positive result is the same missing check in the version that was not patched first.
What happened, in plain words
Google runs a service called Dialogflow. It is a tool for building chatbots: little programs that talk to people, on a website or in a messaging app, and answer their questions. Inside Dialogflow you create something called an agent. The author of this report explains an agent as "just like a project to create everything", which is a good way to picture it: an agent is the container that holds all the pieces of one chatbot.
Inside an agent there is a feature called Test Cases. A test case is a saved example of a conversation you expect the chatbot to handle, so you can check that it still behaves correctly after you change something. You can create test cases, and you can delete them.
This report is about a bug in the delete step. When you click Delete on a test case, your browser sends a small message to Google's servers asking them to remove it. That message contains an identifier for the agent and an identifier for the test case. The servers did not properly check that the agent identifier in the message belonged to you. So if you changed the agent identifier to somebody else's agent, the servers would still carry out the deletion, on that other person's test case.
This kind of bug has a name: IDOR, short for Insecure Direct Object Reference. The everyday comparison is a cloakroom. You hand in your coat and get a ticket with a number on it. If the attendant hands back whatever coat matches the number you say, without checking that the ticket is really yours, then anyone who can guess or learn another number can walk off with someone else's coat. The number is the "direct object reference"; the bug is that the attendant trusts the number instead of checking ownership.
The interesting twist here is that the test case identifiers were not guessable at all. They are long random-looking strings called UUIDs. But because Dialogflow lets you start from a ready-made template (a prebuilt agent), two different people who both start from the same template end up with test cases that have exactly the same identifier. In the author's test, the same prebuilt agent in a second account produced the same test case id. Only the agent id still had to be found, and the author says the integration snippet and the web demo link are the main ways to get it.
The author reported the issue to Google and was paid $3133.70.

The Finding
The author had already reported one access-control bug in Dialogflow before this one, and did not stop there. The conclusion drawn from the earlier work was that the application has a broader problem with broken access control.
Broken access control means the application does not properly check whether the person making a request is allowed to do what they are asking. Think of a hotel where the key card opens your own room but the door staff never check that the card matches the room number you walk up to. The lock works; the checking does not.
Dialogflow comes in two versions, and the report names both:
- Dialogflow Essentials, the original version.
- Dialogflow CX, described in the report as an upgraded version of Essentials with lots of features.
The author searched both for broken access control issues.
The testing was done by hand, not with automated scanners. The reason given is that automated tools are a poor fit when you need to change the request method, add custom headers and make similar adjustments. To unpack that:
- A request is the message your browser sends to a server. It has a method (a verb such as GET for "give me this page" or DELETE for "remove this thing"), a URL, some headers, and sometimes a body.
- Headers are extra lines of information attached to a request, such as what kind of data you are sending or which session you belong to.
- An automated scanner is a program that fires lots of standard test requests at an application. It is fast, but it does not think. A human tester who understands the feature can craft requests a scanner would never try.
While exploring the application, the author noticed an option called Test Cases.

Getting test cases to work with
The Test Cases list was empty, and an attempt to import test cases did not work. Searching online for information about the feature turned up nothing useful. So the author did the thing many testers avoid: read the documentation.
Reading the documentation led to the prebuilt agent feature. A prebuilt agent is a ready-made agent. Instead of building a chatbot from scratch, you pick one and Dialogflow creates a complete agent for you, with its contents already filled in.

Several prebuilt agents were on offer, and the author picked the first one.

Once the prebuilt agent existed, the Test Cases section was no longer empty.


With test cases now present, the author selected one and clicked Delete.

Exploitation
Step 1: capture the delete request
An intercepting proxy is a tool that sits between your browser and the server. Instead of your request going straight out, it stops in the proxy so you can read it, change it, and then let it continue. The author used Burp Suite for this, with its interceptor switched on.
With the interceptor on, clicking Delete produced this request body:
{“names”:[“projects/agent-nameas-nqsq/locations/us-central1/agents/3fbab09c-d034–4f35-bb1f-1ab0837e8806/testCases/9a1c14e8–3dee-43a6–8e58–10d4a1fb8a70”]}
Line by line, in plain words:
- The outer braces
{and}mark this as a JSON object, a common way of writing structured data as text. JSON is just labelled boxes: a name, a colon, and a value. "names"is the label of the box. The value is a list, shown by the square brackets[and]. So the server is being told: here are the names of the things to act on.- Inside the list is one long string in double quotes. That string is a resource path, a way of naming a thing on the server by describing where it lives, like a postal address.
projects/agent-nameas-nqsqis the project part of the address. A project is Google Cloud's container for all your resources, billing and permissions.locations/us-central1says which of Google's data centres holds the resource.agents/3fbab09c-d034–4f35-bb1f-1ab0837e8806is the agent, identified by a long string. That string is a UUID, a universally unique identifier: a long random-looking value that is meant to be practically impossible to guess.testCases/9a1c14e8–3dee-43a6–8e58–10d4a1fb8a70is the test case, also identified by a UUID.
So the body carries two identifiers: the agent id and the test case id. Both are UUIDs. The author judged them hard to guess and impractical to brute force, and initially treated the whole thing as a dead end.
Brute forcing means trying every possible value until one works. With a short number, like a four-digit PIN, a computer can try all ten thousand combinations in moments. With a UUID, the number of possibilities is so vast that trying them all is hopeless.

Step 2: reproduce the same test case in a second account
The idea that broke the dead end was this: why not create the same prebuilt agent in a victim account? If both accounts start from the same template, maybe the contents match too.
A second account was registered, the same prebuilt agent was imported into it, and testing continued from there. In this setup the first account plays the attacker and the second plays the victim. Having two accounts you control is a standard way to test access control: you can see exactly what one account can do to the other's data, without touching anybody real.

Step 3: compare the two delete requests
In the victim account, the same test case was deleted and the request intercepted. The test case id was identical to the one in the attacker account. That is the key observation of the whole report: the same test case id appeared in two separate accounts.
Both requests were then sent to Burp Comparer, a tool that puts two requests side by side and highlights the differences, so you do not have to spot them by eye. The only meaningful difference was the agent id in the path:
agents/3fbab09c-d034–4f35-bb1f-1ab0837e8806
In words: the two requests were identical except for the piece of the address that names the agent. Everything else, including the test case id, matched.
Step 4: swap the agent id
Replacing the attacker's agent id with the victim's agent id in the request deleted the test case in the victim account. That is the vulnerability in action: the server accepted a request from one account and acted on another account's data.
The author is careful about the limits. The agent id is still not guessable and cannot realistically be brute forced, so on its own this trick only works if you already know the victim's agent id. The next step is about getting one.

Step 5: obtain the agent id
Dorking means using search engines with carefully chosen search terms to find pages that expose something useful, such as a configuration file or a code snippet. The author tried this to collect agent ids and it did not work.
So the search moved back into Dialogflow Essentials, looking for any place where an agent id might be shown. The answer was the integration path. To embed an agent in a website, you paste a JavaScript snippet into the page, and the agent id is part of that snippet. JavaScript is the programming language that web pages run in your browser; an integration snippet is a small block of code a service gives you to copy into your site so that its widget appears there.

Alternatively, the agent link can be shared by enabling the web demo. A web demo is a public page Google hosts so you can try a chatbot without embedding anything. The report gives this example:
https://bot.dialogflow.com/be29c5bc-b4b7-4d24-b5ba-ec3d3cbe4ba1
In words: this is a normal web address on bot.dialogflow.com, and the last part of the path is a UUID. That UUID is the agent id. Anyone who can see the link, or the snippet, can read the agent id out of it. The author calls this the main way to obtain an agent id, and also suggests trying different combinations of agent ids.
Step 6: bulk deletion
The author describes the impact as being able to select all test cases and delete them with one click by changing the agent id.
The issue was reported and rewarded $3133.70.
Root cause
The delete operation authorises the request against the agent id supplied in the resource path, but does not verify that the caller owns or has access to that agent. So a test case id belonging to one agent can be deleted through another agent's path.
In the author's test, importing the same prebuilt agent into a second account produced the same test case id. A tenant here just means a separate customer or account using the same service. That identical id removes the need to know the victim's test case id at all; only the agent id has to be discovered.
The report does not describe the server-side check that was missing, so the exact mechanism is likely a missing ownership check on the parent agent.
Impact
An attacker who knows a victim's agent id can delete that agent's test cases; the author describes selecting all test cases and deleting them with one click by changing the agent id. The author is explicit about the limits: the agent id is not guessable and cannot be brute forced, so the attack depends on obtaining it from a public integration snippet or a shared web demo link. The report does not describe any other effect beyond deletion of test cases.
Fix
The report records that the issue was fixed on Jul 5, 2021, but does not say what changed. A server-side ownership check tying the test case to an agent the caller can access would address the behaviour described.
Timeline
| Date | Event |
|---|---|
| May 27, 2021 12:50AM | Reported |
| May 27, 2021 04:15AM | Assigned |
| May 27, 2021 06:45PM | Accepted |
| Jun 17, 2021 12:20PM | Rewarded $3133.70 |
| Jul 5, 2021 08:45AM | Fixed |
Variants to test
These are the follow-up ideas the technical version lists, explained for someone starting out. Each one is a way to look for the same class of mistake in a slightly different place.
- Template-derived identifiers. Create the same prebuilt agent or project template in two accounts and compare object ids. A positive result is an identical child object id across tenants, which removes the guessing barrier for that id. In plain words: if two accounts built from the same template share an id, that id is no longer a secret.
- Parent id swap in batch endpoints. Take any request whose body is a list of resource names and replace the parent id with one from a second account. A positive result is a 200 response and the object disappearing from the victim account. A batch endpoint is a part of the service that handles many items in one request; the parent id is the identifier of the container those items live in, such as the agent.
- Agent id discovery. Check public integration snippets, web demo links and any other embeddable configuration for the agent id. A positive result is an id that maps to a live agent you do not own.
- Sibling methods. Repeat the swap on read, update and export operations on the same resource, not only delete. A positive result is data from the victim account returned to the attacker. Sibling methods means the other actions available on the same kind of object: if delete is broken, reading or updating might be too.
- Cross-version parity. Test the same feature in both Dialogflow Essentials and Dialogflow CX. A positive result is the same missing check in the version that was not patched first. Parity here means the two versions behaving the same way, including in their mistakes.
Glossary
- Access control: the rules that decide who is allowed to do what. Broken access control means those rules are missing or not enforced.
- Agent: in Dialogflow, the container for one chatbot project, holding all its settings, intents and test cases.
- API: the interface a program uses to talk to a service, sending requests and receiving responses, usually in a structured format such as JSON.
- Attacker account: the account you control when testing, from which you send the malicious request.
- Batch endpoint: a part of a service that processes many items in a single request.
- Broken access control: a class of bug where the application fails to check whether the requester is allowed to perform the action.
- Brute force: trying every possible value until one works; impractical against long random identifiers.
- Burp Comparer: a tool in Burp Suite that shows two requests or responses side by side and highlights the differences.
- Burp Suite: a widely used tool for intercepting, inspecting and modifying web traffic between a browser and a server.
- Dialogflow: Google's platform for building conversational agents (chatbots).
- Dialogflow CX: the upgraded version of Dialogflow Essentials, with more features.
- Dialogflow Essentials: the original version of Dialogflow.
- Dorking: using search engines with crafted search terms to find exposed information.
- Header: an extra line of information attached to a request or response, such as the data type or session details.
- IDOR (Insecure Direct Object Reference): a bug where an application uses an identifier supplied by the user to reach an object without checking that the user owns or may access that object.
- Integration snippet: a small block of code a service gives you to paste into a website so its widget appears there.
- Intercepting proxy: a tool that sits between browser and server, letting you read and change requests before they are sent.
- JavaScript: the programming language web pages run in the browser.
- JSON: a text format for structured data, built from names, values, lists and objects.
- Parent id: the identifier of the container an object lives in, such as the agent that holds a test case.
- Prebuilt agent: a ready-made Dialogflow template that creates a complete agent with its contents already filled in.
- Project: Google Cloud's container for resources, billing and permissions.
- Request: the message a browser or tool sends to a server, with a method, a URL, headers and sometimes a body.
- Request method: the verb of a request, such as GET to read or DELETE to remove.
- Resource path: a way of naming a thing on a server by describing where it lives, like a postal address.
- Sibling methods: the other actions available on the same kind of object, such as read, update and export alongside delete.
- Tenant: a separate customer or account using the same shared service.
- Test case: a saved example conversation used to check that a chatbot still behaves as expected.
- UUID: universally unique identifier; a long random-looking string used to identify something, intended to be practically impossible to guess.
- Victim account: the second account you control when testing, whose data you try to affect from the attacker account.
- Web demo: a public page hosted by the service that lets anyone try a chatbot, often exposing its identifier in the link.