Skip to content
IDOR Disclosed report Beginner

IDOR in Zentao integration leaks details of issues from a users other "products"

The Zentao integration in GitLab allows fetching issue details by issue key without verifying that the issue belongs to the configured product. An attacker can enumerate issue keys to access issues from other products, potentially unauthenticated if the project is public.

GitLab

Originally disclosed on GitLab

  • Fixed in 4 months
  • Disclosed after 4 months

HackerOne report #1542834 by joaxcar on 2022-04-16, assigned to @ngeorge1:

Report | How To Reproduce

Report

Summary

Maintainers of projects with a premium subscription have the option to enable "Zentao product integration" (documentation).

This enables users with access to the project to view a list of product issues synced from a connected Zentao product by visiting https://gitlab.com/GROUPNAME/PROJECTNAME/-/integrations/zentao/issues .

And issue details by visiting https://gitlab.com/GROUPNAME/PROJECTNAME/-/integrations/zentao/issues/ISSUE-KEY

When configuring this feature, the maintainer is made to enter a product ID

ZenTao Product ID: To display issues from a single ZenTao product in a given GitLab project. The Product ID can be found in the ZenTao product page under Settings > Overview.

This is to connect the current GitLab project with the target Zentao product

The way GitLab handles this functionality is by requesting the maintainer to enter two things other than the project key

  1. Zentao instance URL
  2. Zentao API key

When a user visits the /-/integrations/zentao/issues page the GitLab backend makes a request towards Zentao like so

https://username.zentao.net/api.php/v1/products/3/issues  

Which returns a list of all issues related to product with ID 3.

When clicking on one of these issues in the UI the user is redirected to /-/integrations/zentao/issues/issue-1 and the backend will make a request like so

https://jihudemo.zentao.net/api.php/v1/issues/issue-1  

This request does not contain any check as to which product this issue is related. So by enumerating issue titles such as task-ID, bug-ID, story-ID and so on an attacker can enumerate all issues from all products the maintainer controls in its Zentao instance.

A small discussion on CVSS

I am not completely sure on how this is intended to work, and Zentao's English documentation is a bit sparse. But from what I have gathered in the GitLab documentation, and issues surrounding this, the intention is to connect ONE GitLab project with ONE Zentao product.

So any issues not related to this given product should not be accessible to other users.

My understanding of Zentao is that the user can organize issues in products, but all issues share names with incrementing values. So two products with two bug issues will create the four bug IDs

bug-1  
bug-2  
bug-3  
bug-4  

This is the same for issue types of task and story. This makes it extremely easy to enumerate these issues. Hence, the complexity scoring of Low.

There is also no restriction for this feature being used as the issue tracker for a public project. If this is done, the attacker can perform the attack unauthenticated.

I will report this with a CVSS which is the "highest possible impact" as nothing I have described above is outside "normal workflow". But as usual I understand that the scoring can be subject to change :)

Steps to reproduce

I will use the test account that is used in GitLab issues regarding Zentao. Zentao demo account from https://gitlab.com/gitlab-org/gitlab/-/issues/338178

Zentao Web URL: https://jihudemo.zentao.net
Zentao API token: a70fe861f1e60a3bfd857133798f2f1f
Zentao Product ID: 4

  1. Create a user to use as the victim
  2. Create a new public project (with minimum premium access to GitLab)
  3. In the project page go to

https://gitlab.com/GROUPNAME/PROJECTNAME/-/integrations/zentao/edit
4. Fill in the test credentials from above (use product ID 4 as this one only contains one issue)
5. Click save
6. Log out
7. Go to

https://gitlab.com/GROUPNAME/PROJECTNAME/-/integrations/zentao/issues
8. The page will list all issues related to the Product. In this case ONE bug issue
9. Click the issue (bug-8) and you will go to

https://gitlab.com/GROUPNAME/PROJECTNAME/-/integrations/zentao/issues/bug-8
10. Now change bug-8 to bug-1
11. Details of another product is shown
12. Start enumerating

Impact

Zentao integration leaks a user's ALL issues from ALL products even if the documentation states that it will show issues from ONE product

Examples

Visit my public project at

https://gitlab.com/ultimate_joaxcar_2/kk/-/integrations/zentao/issues

This is accessible as an unauthenticated user.

Try to enumerate issues with names such as bug-1, task-1 and story-1

What is the current bug behavior?

GitLab uses Zentao issue key directly from attacker supplied URL without matching it to the configured product key.

What is the expected correct behavior?

A project should only fetch keys that match the configured key base

Output of checks

This bug happens on GitLab.com

Impact

Zentao integration leaks a user's ALL issues from ALL products even if the documentation states that it will show issues from ONE product

How To Reproduce

Please add reproducibility information to this section:

The original report as published on GitLab. Images and videos are our own copies; raw HTML is shown as text. View it on GitLab.

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

GitLab projects on a premium subscription can enable a feature called "Zentao product integration", documented at https://docs.gitlab.com/ee/user/project/integrations/zentao.html. The idea is to connect one GitLab project to one Zentao product, so that people with access to the project can browse the issues of that product from inside GitLab.

Two pages make up the user-facing side of the feature:

  • https://gitlab.com/GROUPNAME/PROJECTNAME/-/integrations/zentao/issues lists the issues synced from the connected Zentao product.
  • https://gitlab.com/GROUPNAME/PROJECTNAME/-/integrations/zentao/issues/ISSUE-KEY shows the details of a single issue.

When a maintainer configures the integration, they supply a Zentao instance URL, a Zentao API key and a product ID. The configuration form describes the last field as:

ZenTao Product ID: To display issues from a single ZenTao product in a given GitLab project. The Product ID can be found in the ZenTao product page under Settings > Overview.

So the stated contract is one GitLab project bound to one Zentao product, and only that product's issues should be visible through the project.

Setup

The researcher used the Zentao demo account that appears in GitLab's own issue tracker discussion at https://gitlab.com/gitlab-org/gitlab/-/issues/338178. The credentials quoted in the report are:

Zentao Web URL: https://jihudemo.zentao.net Zentao API token: [redacted] Zentao Product ID: 4

Product ID 4 was chosen because, according to the report, it contains only one issue. The reproduction needs a GitLab user to act as the victim, a new public project on a GitLab instance with at least premium access, and the ability to log out and browse as an unauthenticated visitor. No special tooling is required: a browser and the ability to edit a URL are enough.

Finding it

The researcher looked at how the two pages fetch data from Zentao. The list page causes the GitLab backend to request the issues of the configured product:

https://username.zentao.net/api.php/v1/products/3/issues

That request is scoped to product ID 3 and returns the issues belonging to that product. The detail page, however, causes a different request. When a user opens /-/integrations/zentao/issues/issue-1, the backend requests:

https://jihudemo.zentao.net/api.php/v1/issues/issue-1

This second request carries no check tying the issue to the configured product. The issue key from the URL is passed straight to Zentao, so any issue key that exists in the Zentao instance can be fetched, regardless of which product it belongs to.

The researcher also reasoned about how easy enumeration is. In Zentao, issues are organised into products, but issue identifiers are shared and incrementing across the instance. Two products that each contain two bug issues produce four IDs:

bug-1
bug-2
bug-3
bug-4

The same applies to the task and story issue types. Because the keys are sequential and predictable, walking through them is trivial, which is why the researcher scored complexity as Low.

A further observation: nothing prevents the integration from being used as the issue tracker of a public project. When that is the case, the attack can be performed without authenticating at all.

The researcher noted that the Zentao English documentation is sparse and that the intended behaviour was inferred from the GitLab documentation and surrounding issues, but the conclusion was that one GitLab project is meant to map to one Zentao product, and issues outside that product should not be reachable by other users. The report was filed with a CVSS reflecting the highest possible impact, on the basis that nothing described is outside the normal workflow, while acknowledging that the score could change.

Exploitation

Step 1: create the victim user

Create a user to act as the victim.

Step 2: create a public project

Create a new public project on a GitLab instance with minimum premium access.

Step 3: open the integration settings

In the project, go to:

https://gitlab.com/GROUPNAME/PROJECTNAME/-/integrations/zentao/edit

Step 4: fill in the credentials

Enter the demo credentials from the setup section, using product ID 4, which contains only one issue.

Step 5: save

Click save.

Step 6: log out

Log out so that the following steps run as an unauthenticated visitor.

Step 7: open the issue list

Go to:

https://gitlab.com/GROUPNAME/PROJECTNAME/-/integrations/zentao/issues

Step 8: observe the scoped list

The page lists all issues related to the configured product. In this case that is one bug issue.

Step 9: open the issue

Click the issue, bug-8, which takes you to:

https://gitlab.com/GROUPNAME/PROJECTNAME/-/integrations/zentao/issues/bug-8

Step 10: change the key

Edit the URL and replace bug-8 with bug-1.

Step 11: read another product's issue

The details of an issue belonging to a different product are shown.

Step 12: enumerate

Repeat with other keys to walk through the issues of every product in the Zentao instance.

The researcher published a public project demonstrating the issue at:

https://gitlab.com/ultimate_joaxcar_2/kk/-/integrations/zentao/issues

It is reachable as an unauthenticated user, and the suggested test is to enumerate keys such as bug-1, task-1 and story-1.

Root cause

As the researcher put it, GitLab uses the Zentao issue key directly from the attacker-supplied URL without matching it to the configured product key. The list endpoint is built around the configured product ID, but the detail endpoint is built around whatever key appears in the path, and the backend forwards that key to Zentao without verifying that the issue belongs to the product the integration was configured for. The expected behaviour, in the researcher's words, is that a project should only fetch keys that match the configured key base.

Impact

The integration leaks all of a user's issues from all products, even though the documentation states that it shows issues from one product. The exposure applies to all issues from all products the maintainer controls in the Zentao instance, across bug, task and story types, and the sequential key scheme makes discovery of those issues easy. Where the integration is attached to a public GitLab project, the leak is available to unauthenticated visitors.

Fix

The report does not describe a fix or a remediation commit. The behaviour it asks for is that the project only fetch keys matching the configured key base, that is, that the detail lookup be constrained to the product the integration was configured with.

Variants to test

  1. Other integrations that proxy a remote tracker by key. Look for GitLab integrations, or similar proxy features in other products, where a list view is scoped to a configured container but a detail view takes an identifier from the path. A positive result is a detail page that returns an object from outside the configured container when you change the identifier.
  2. Sequential key schemes in the remote system. Where the upstream tracker shares an incrementing namespace across containers, as Zentao does for bug, task and story, try neighbouring keys and other prefixes. A positive result is any object that the configured container should not expose.
  3. Public projects with tracker integrations. Enable the integration on a public project and repeat the request while logged out. A positive result is the same data being returned to an unauthenticated client.
  4. Different issue types. If the list view only shows one type, try the other prefixes the upstream system uses. A positive result is a type that the integration was never meant to surface at all.

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

What happened, in plain words

GitLab is a website where teams keep their code and track work on it. Some teams pay for a premium subscription, which unlocks extra features. One of those features lets a GitLab project show a list of issues from a separate bug-tracking system called Zentao, without leaving GitLab.

An issue is just a ticket: a bug report, a task, or a user story. Zentao is a tool that stores such tickets. A product in Zentao is a container that groups related tickets together, a bit like a folder groups files.

The feature is meant to connect one GitLab project to one Zentao product. The researcher found that the connection only holds for the list of issues. If you open a single issue, GitLab asks Zentao for whatever ticket number appears in the web address, without checking that the ticket belongs to the product the project was set up for. By changing the number in the address, a visitor can read tickets from every product the Zentao account can see.

This kind of mistake has a name: IDOR, short for Insecure Direct Object Reference. It means a program takes an identifier supplied by the user (here, a ticket number in the URL) and fetches the matching object without checking whether this user is allowed to see that object. An everyday comparison: a hotel receptionist hands you the key to room 101, and you notice the keys are numbered, so you ask for the key to room 102 and get it, even though you only booked room 101.

The feature and its two pages

The integration is documented at https://docs.gitlab.com/ee/user/project/integrations/zentao.html. The idea is to connect one GitLab project to one Zentao product, so that people with access to the project can browse that product's issues from inside GitLab.

Two pages make up the part users see:

  • https://gitlab.com/GROUPNAME/PROJECTNAME/-/integrations/zentao/issues lists the issues synced from the connected Zentao product.
  • https://gitlab.com/GROUPNAME/PROJECTNAME/-/integrations/zentao/issues/ISSUE-KEY shows the details of a single issue.

GROUPNAME and PROJECTNAME are placeholders for the real names of the group and project on GitLab. ISSUE-KEY is a placeholder for the ticket's identifier, such as bug-8.

When a maintainer (someone with permission to change a project's settings) sets up the integration, they provide three things: the web address of the Zentao instance, an API key, and a product ID.

An API is a way for one program to talk to another over the web, asking for data and getting it back in a structured form. An API key is a long secret string that proves to the other program who is asking, like a password that a program uses instead of a person. Whoever holds the key can read whatever the key is allowed to read.

The configuration form describes the product ID field like this:

ZenTao Product ID: To display issues from a single ZenTao product in a given GitLab project. The Product ID can be found in the ZenTao product page under Settings > Overview.

So the promise is clear: one GitLab project is bound to one Zentao product, and only that product's issues should be visible through the project.

Setting up the test

The researcher used the Zentao demo account that appears in a discussion on GitLab's own issue tracker at https://gitlab.com/gitlab-org/gitlab/-/issues/338178. The credentials quoted in the report are:

Zentao Web URL: https://jihudemo.zentao.net Zentao API token: [redacted] Zentao Product ID: 4

Product ID 4 was chosen because, according to the report, it contains only one issue. That makes the demonstration easy to follow: the list page should show exactly one ticket, and anything else that appears is out of scope.

The reproduction needs a GitLab user to act as the victim, a new public project on a GitLab instance with at least premium access, and the ability to log out and browse as an unauthenticated visitor. No special tooling is required: a browser and the ability to edit a URL are enough.

Finding it

The researcher looked at how the two pages fetch data from Zentao. The list page makes the GitLab backend request the issues of the configured product:

https://username.zentao.net/api.php/v1/products/3/issues

Line by line:

  • https://username.zentao.net is the address of a Zentao instance. username is a placeholder for the account name in that address.
  • /api.php/v1/ is the part of the address that says "this is the API, version 1".
  • products/3/issues asks for the issues that belong to product number 3.

That request is scoped to product ID 3 and returns the issues belonging to that product. The word scoped means the request is limited to one container: the server is told which product to look inside, and it answers only about that product.

The detail page, however, makes a different request. When a user opens /-/integrations/zentao/issues/issue-1, the backend requests:

https://jihudemo.zentao.net/api.php/v1/issues/issue-1

Line by line:

  • https://jihudemo.zentao.net is the Zentao instance from the setup.
  • /api.php/v1/issues/issue-1 asks for one issue by its key, issue-1.

Notice what is missing compared with the first request: there is no products/3 in the path. The request names the ticket directly and never mentions a product. This second request carries no check tying the issue to the configured product. The issue key from the URL is passed straight to Zentao, so any issue key that exists in the Zentao instance can be fetched, regardless of which product it belongs to.

The researcher also reasoned about how easy enumeration is. Enumeration means trying identifiers one after another, in order, to discover what exists. In Zentao, issues are organised into products, but issue identifiers are shared and incrementing across the instance. Two products that each contain two bug issues produce four IDs:

bug-1
bug-2
bug-3
bug-4

Line by line:

  • bug-1 and bug-2 are the two bugs of the first product.
  • bug-3 and bug-4 are the two bugs of the second product.

The numbering does not restart for each product; it keeps counting across the whole instance. So if you know that bug-1 exists, you can guess that bug-2, bug-3 and so on probably exist too. The same applies to the task and story issue types. Because the keys are sequential and predictable, walking through them is trivial, which is why the researcher scored complexity as Low.

A further observation: nothing prevents the integration from being used as the issue tracker of a public project. A public project is one that anyone on the internet can view, even without an account. When that is the case, the attack can be performed without authenticating at all, meaning without logging in.

The researcher noted that the Zentao English documentation is sparse and that the intended behaviour was inferred from the GitLab documentation and surrounding issues, but the conclusion was that one GitLab project is meant to map to one Zentao product, and issues outside that product should not be reachable by other users. The report was filed with a CVSS reflecting the highest possible impact, on the basis that nothing described is outside the normal workflow, while acknowledging that the score could change. CVSS is a standard scoring system for rating how serious a security flaw is; the score is a number, and the report does not give the number it used.

Exploitation

Step 1: create the victim user

Create a user to act as the victim. Create a user to act as the victim.

Step 2: create a public project

Create a new public project on a GitLab instance with minimum premium access. The project is made public so that the later steps can be repeated without logging in.

Step 3: open the integration settings

In the project, go to:

https://gitlab.com/GROUPNAME/PROJECTNAME/-/integrations/zentao/edit

Line by line:

  • https://gitlab.com is the GitLab website.
  • GROUPNAME/PROJECTNAME points at the specific project.
  • /-/integrations/zentao/edit is the settings page for the Zentao integration, the page where the maintainer fills in the connection details.

Step 4: fill in the credentials

Enter the demo credentials from the setup section, using product ID 4, which contains only one issue. This is the normal configuration a maintainer would do; nothing unusual is being entered.

Step 5: save

Click save. Click save.

Step 6: log out

Log out so that the following steps run as an unauthenticated visitor.

Step 7: open the issue list

Go to:

https://gitlab.com/GROUPNAME/PROJECTNAME/-/integrations/zentao/issues

Line by line:

  • https://gitlab.com/GROUPNAME/PROJECTNAME is the same public project.
  • /-/integrations/zentao/issues is the list page of the integration.

Step 8: observe the scoped list

The page lists all issues related to the configured product. In this case that is one bug issue. In this case that is one bug issue.

Step 9: open the issue

Click the issue, bug-8, which takes you to:

https://gitlab.com/GROUPNAME/PROJECTNAME/-/integrations/zentao/issues/bug-8

Line by line:

  • The first part is the same project and integration.
  • bug-8 at the end is the key of the ticket you clicked.

Step 10: change the key

Edit the URL and replace bug-8 with bug-1. This is the whole attack: one number in the address bar is changed by hand.

Step 11: read another product's issue

The details of an issue belonging to a different product are shown.

Step 12: enumerate

Repeat with other keys to walk through the issues of every product in the Zentao instance. Because the keys are sequential and predictable, walking through them is trivial.

The researcher published a public project demonstrating the issue at:

https://gitlab.com/ultimate_joaxcar_2/kk/-/integrations/zentao/issues

Line by line:

  • https://gitlab.com/ultimate_joaxcar_2/kk is the researcher's own public project.
  • /-/integrations/zentao/issues is the integration list page, reachable by anyone.

It is reachable as an unauthenticated user, and the suggested test is to enumerate keys such as bug-1, task-1 and story-1.

Root cause

As the researcher put it, GitLab uses the Zentao issue key directly from the attacker-supplied URL without matching it to the configured product key. The list endpoint is built around the configured product ID, but the detail endpoint is built around whatever key appears in the path, and the backend forwards that key to Zentao without verifying that the issue belongs to the product the integration was configured for. The expected behaviour, in the researcher's words, is that a project should only fetch keys that match the configured key base.

In everyday terms: the list page asks "give me everything in folder 4", but the detail page asks "give me the file named bug-1" and never checks which folder that file lives in.

Impact

The integration leaks all of a user's issues from all products, even though the documentation states that it shows issues from one product. The exposure applies to all issues from all products the maintainer controls in the Zentao instance, across bug, task and story types, and the sequential key scheme makes discovery of those issues easy. Where the integration is attached to a public GitLab project, the leak is available to unauthenticated visitors.

Fix

The report does not describe a fix or a remediation commit. The behaviour it asks for is that the project only fetch keys matching the configured key base, that is, that the detail lookup be constrained to the product the integration was configured with.

Variants to test

  1. Other integrations that proxy a remote tracker by key. Look for GitLab integrations, or similar proxy features in other products, where a list view is scoped to a configured container but a detail view takes an identifier from the path. A positive result is a detail page that returns an object from outside the configured container when you change the identifier.
  2. Sequential key schemes in the remote system. Where the upstream tracker shares an incrementing namespace across containers, as Zentao does for bug, task and story, try neighbouring keys and other prefixes. A positive result is any object that the configured container should not expose.
  3. Public projects with tracker integrations. Enable the integration on a public project and repeat the request while logged out. A positive result is the same data being returned to an unauthenticated client.
  4. Different issue types. If the list view only shows one type, try the other prefixes the upstream system uses. A positive result is a type that the integration was never meant to surface at all.

Glossary

  • API: a way for one program to ask another program for data over the web, in a structured format.
  • API key: a long secret string that a program presents to prove who it is, like a password for software.
  • Backend: the part of a website that runs on the server and does the actual work, as opposed to the pages you see in the browser.
  • Bug: a ticket describing something that is broken.
  • Container: a grouping that holds related items, such as a product holding tickets or a folder holding files.
  • CVSS: a standard scoring system for rating the severity of a security flaw.
  • Endpoint: a specific address on a server that accepts a particular kind of request.
  • Enumeration: trying identifiers one after another, in order, to discover which ones exist.
  • IDOR (Insecure Direct Object Reference): a flaw where a program fetches an object using an identifier supplied by the user without checking that the user may see that object.
  • Integration: a feature that connects one product to another so data can flow between them.
  • Issue: a ticket in a tracker, such as a bug, a task or a story.
  • Issue key: the identifier of a ticket, such as bug-8.
  • Maintainer: a person with permission to change a project's settings.
  • Product (Zentao): a container inside Zentao that groups related tickets.
  • Product ID: the number that identifies a Zentao product.
  • Public project: a project that anyone on the internet can view, even without an account.
  • Scoped: limited to one container, so that only items inside it are returned.
  • Story: a ticket describing a feature or requirement from a user's point of view.
  • Task: a ticket describing a piece of work to be done.
  • Unauthenticated: not logged in, so the server does not know who you are.
  • URL: the address of a page or resource on the web, the text in the browser's address bar.
  • Victim: the person whose account or data is exposed by the flaw.
  • Zentao: a bug-tracking system that stores issues in products.

More from GitLab

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.