Release evidence leaks public/confidential issues of restricted projects
The release evidence endpoint did not check whether the user had permission to view the project's issues, only whether they could access the release. An unauthenticated user could download the evidence JSON and read titles and descriptions of public and confidential issues, plus milestone data.
GitLab
Originally disclosed on GitLab
- Fixed in 8 days
- Disclosed after 8 days
HackerOne report #745571 by xanbanx on 2019-11-25, assigned to @cmaxim:
Hi GitLab Security Team,
Summary
GitLab recently added a feature called Release evidence (https://docs.gitlab.com/ee/user/project/releases/#release-evidence). The goal of this feature is to collect all created issues for one release (link happens via the assigned milestone). When a release is created, you then can download this snapshot of issue data via a new endpoint provided by the release API.
However, here comes the problem. This endpoint does not respect the users issue privileges. It only checks if the user has access to a release but not to the issue tracker of this project.
Thus, any unauthorized user who van view the release but does not have access to the issues can download the evidence data and thus gets access to all associated issues. This includes the public (but restricted) issues but also the confidential issues.
Steps to reproduce
- Create a public project and restrict issues and merge requests to project members only
- Inside that public project, create a milestone, i.e., named
My-Milestone - Create a public issue and set the milestone to the previously created milestone
- Create a confidential issue and set the milestone to the previously created milestone
- Create a git tag, i.e., named
v1.0 - Create a new release via the API with the milestone attached by using the following API call:
curl -X POST -H "Private-Token: <Private-Token>" https://example.gitlab.com/api/v4/projects/<project-id>/releases?tag_name=<v1.0>\&description=Public-release\&milestones[]=My-Milestone
- When querying the release via the API, a new field
evidence_file_pathwith an URL to the evidence is returned. As an unauthenticated users, visit this link, which is in the form of https://example.gitlab.com/<namespace>/<project-name>/-/releases/v1.0/evidence.json. Thev1.0corresponds to the git tag
This returns JSON data in similar to this one:
{
"release": {
"id": 1,
"name": "My release",
"project": {
"id": 1,
"name": "My project",
"created_at": "2019-11-24T17:10:12.993Z",
"description": null
},
"tag_name": "v1.0",
"created_at": "2019-11-24T17:10:17.512Z",
"milestones": [
{
"id": 1,
"iid": 1,
"state": "active",
"title": "My-Milestone",
"issues": [
{
"id": 3,
"iid": 1,
"state": "opened",
"title": "My public issue",
"due_date": null,
"created_at": "2019-11-24T17:10:15.123Z",
"description": "This is a public issue",
"confidential": false
},
{
"id": 4,
"iid": 2,
"state": "opened",
"title": "Secret confidential issue, RCE",
"due_date": null,
"created_at": "2019-11-24T17:10:15.653Z",
"description": "This is a secret issue discussing a critical RCE vulnerability",
"confidential": true
}
],
"due_date": null,
"created_at": "2019-11-24T17:10:14.857Z",
"description": null
}
],
"description": "Public-release"
}
}
As you can see, this leaks the issue titles and the description of the public issue and even more critical the also the title of the confidential issue. (property confidential: true).
Furthermore, the JSON response also leaks:
- the milestone
The described steps also work for private projects. Here, Guest users, who don't have access to confidential issues can get access to them via the release evidence download.
Impact
The evidence feature leaks public issues and confidential issues to unauthorized users without issue access. Furthermore, milestones are leaked. Since, confidential issues are leaked, this raises to a critical vulnerability since those issues describe the most sensitive content inside a project.
Examples
As an unauthorized user visit the following release page: https://gitlab.com/wter23/evidence-test
As you can see from the side bar, you don't have access to the issue tracker.
Now visit https://gitlab.com/wter23/evidence-test/-/releases/v1.0/evidence.json to retrieve the payload of the evidence.
The response leaks the public and confidential issues, the git tag, and the milestone.
What is the current bug behavior?
Anyone with access to the release page can download the evidence snapshot and thus gets access to (confidential) issues, milestone data, and the git tag, which is restricted.
What is the expected correct behavior?
If the user does not have access to the issues, the evidence snapshot cannot be downloaded.
Output of checks
This bug happens on GitLab.com running on version GitLab Enterprise Edition 12.5.0-pre e56cf44dfbd (Canary)
Best regards,
Xanbanx
Impact
See above.
Context
GitLab added a feature called Release evidence, documented at https://docs.gitlab.com/ee/user/project/releases/#release-evidence. Its purpose is to collect all issues created for a single release, with the link between release and issues made through the assigned milestone. When a release is created, the snapshot of issue data can be downloaded through a new endpoint exposed by the release API.
The report is about that download endpoint and the authorisation checks it performs. The target is GitLab.com, and the report notes the bug happens on GitLab Enterprise Edition 12.5.0-pre e56cf44dfbd (Canary).
Setup
The researcher needed a project where the issue tracker is restricted, so that a user can see a release but not the issues behind it. The reproduction uses a public project with issues and merge requests restricted to project members only. The same steps were also confirmed to work for private projects, where Guest users who do not have access to confidential issues can reach them through the release evidence download.
No special tooling is described beyond the GitLab API and a private token for the setup calls, plus an unauthenticated browser session for the final request.
Finding it
The release evidence endpoint checks whether the user has access to a release, but it does not check the user's issue privileges. It never verifies access to the issue tracker of the project. As a result, any unauthorised user who can view the release but has no access to the issues can download the evidence data and obtain all associated issues. That includes the public but restricted issues and, more seriously, the confidential issues.
Exploitation
Step 1: create a public project with restricted issues
Create a public project and restrict issues and merge requests to project members only. This is the precondition that makes the leak meaningful: the project itself is visible, the issue tracker is not.
Step 2: create a milestone
Inside that public project, create a milestone, for example named My-Milestone. The milestone is what ties issues to the release.
Step 3: create a public issue on the milestone
Create a public issue and set its milestone to the milestone created in step 2.
Step 4: create a confidential issue on the milestone
Create a confidential issue and set its milestone to the same milestone.
Step 5: create a git tag
Create a git tag, for example named v1.0. The tag name is what the evidence URL will be built from.
Step 6: create the release through the API
Create a new release via the API with the milestone attached:
curl -X POST -H "Private-Token: <Private-Token>" https://example.gitlab.com/api/v4/projects/<project-id>/releases?tag_name=<v1.0>\&description=Public-release\&milestones[]=My-Milestone
Step 7: fetch the evidence as an unauthenticated user
When the release is queried through the API, a new field evidence_file_path is returned, containing a URL to the evidence. As an unauthenticated user, visit that link, which has the form:
https://example.gitlab.com/<namespace>/<project-name>/-/releases/v1.0/evidence.json
Here v1.0 corresponds to the git tag. The response is JSON similar to the following:
{
"release": {
"id": 1,
"name": "My release",
"project": {
"id": 1,
"name": "My project",
"created_at": "2019-11-24T17:10:12.993Z",
"description": null
},
"tag_name": "v1.0",
"created_at": "2019-11-24T17:10:17.512Z",
"milestones": [
{
"id": 1,
"iid": 1,
"state": "active",
"title": "My-Milestone",
"issues": [
{
"id": 3,
"iid": 1,
"state": "opened",
"title": "My public issue",
"due_date": null,
"created_at": "2019-11-24T17:10:15.123Z",
"description": "This is a public issue",
"confidential": false
},
{
"id": 4,
"iid": 2,
"state": "opened",
"title": "Secret confidential issue, RCE",
"due_date": null,
"created_at": "2019-11-24T17:10:15.653Z",
"description": "This is a secret issue discussing a critical RCE vulnerability",
"confidential": true
}
],
"due_date": null,
"created_at": "2019-11-24T17:10:14.857Z",
"description": null
}
],
"description": "Public-release"
}
}
The response leaks the issue titles and the description of the public issue, and, more critically, the title of the confidential issue, which is marked with confidential: true. The JSON response also leaks the milestone.
Confirmed example on GitLab.com
As an unauthorised user, visit the release page at https://gitlab.com/wter23/evidence-test. The side bar shows that the user has no access to the issue tracker.
Then visit https://gitlab.com/wter23/evidence-test/-/releases/v1.0/evidence.json to retrieve the evidence payload. The response leaks the public and confidential issues, the git tag and the milestone.
Root cause
The evidence endpoint checks access to the release but does not respect the user's issue privileges or check access to the project's issue tracker. The snapshot includes the issues attached to the milestone, confidential ones included, and the milestone data itself.
Impact
The evidence feature leaks public issues and confidential issues to unauthorised users who have no issue access, and it also leaks milestones. The researcher rates this as critical because confidential issues describe the most sensitive content inside a project. The described steps also work for private projects: Guest users, who do not have access to confidential issues, can reach them through the release evidence download. Anyone with access to the release page can download the evidence snapshot and thereby obtain the restricted issues, milestone data and git tag.
The expected behaviour is that if the user does not have access to the issues, the evidence snapshot cannot be downloaded.
Fix
The report does not describe a fix or a change that was made. The behaviour it asks for is that the evidence snapshot is not downloadable when the user lacks access to the issues.
Variants to test
- Private project with a Guest member: create a release on a milestone holding a confidential issue, then fetch the evidence URL as the Guest. A positive result is a JSON body containing the confidential issue's title and
confidential: true. - Public project with issues restricted to members: fetch the evidence URL with no session at all. A positive result is a JSON body with issue titles and descriptions that the anonymous user cannot see in the UI.
- A positive result is child data appearing for a user who cannot open the child in the UI.
What happened, in plain words
GitLab is a website where teams keep their software projects. Inside a project you can store code, but you can also keep lists of tasks, called issues, and group those tasks into batches called milestones. A milestone is like a folder label: "everything we want to finish for version 1.0 goes in this milestone".
GitLab added a feature called Release evidence. A release is a moment when a version of the software is published, and the evidence is a snapshot: a file that collects all the issues that belong to the milestone attached to that release, so you have a record of what went into the release. You download the snapshot from a web address that the release API hands back to you.
The problem the researcher found is simple to state. That download address checks one thing: whether you are allowed to see the release. It never checks whether you are allowed to see the issues. So a person who can see the release page but is locked out of the issue tracker can still download the snapshot, and the snapshot contains every issue in the milestone, including issues marked confidential. Confidential issues are the ones a team keeps private, so this is a serious leak.
The researcher rated it critical, because confidential issues are where a project keeps its most sensitive information. The same trick also worked on private projects, where Guest users who do not have access to confidential issues could reach them through the evidence download.
Background you need first
A few ideas come up again and again, so here they are from zero.
Project. A workspace on GitLab holding code and related material. A project can be public (anyone can see it) or private (only invited people can see it).
Issue. A task, bug report or discussion item inside a project. Issues can be public to everyone who can see the project, or marked confidential, which hides them from most users.
Milestone. A named batch that issues can be assigned to, used to group work towards a goal such as a release.
Git tag. A label attached to a specific point in the project's code history, typically a version number such as v1.0. Think of it as a bookmark in the code.
Release. A published version of the software, tied to a tag, with a description and optionally a milestone.
API. A way for programs, rather than people clicking buttons, to talk to a website. You send a request to a web address and get data back, usually in a format called JSON, which is just structured text with names and values. Think of the API as the service counter at a shop: you ask for something specific and get it in a standard form.
Endpoint. One specific address on that API that does one job, for example "create a release" or "download the evidence".
Token. A long secret string that proves who you are when you call the API, like a membership card you show at the counter. The Private-Token header is simply the place in the request where that card is presented.
Header. Extra information attached to a web request, such as who is asking or what format they want back.
Authorisation. Deciding whether an identified user is allowed to do a particular thing. Authentication is "who are you"; authorisation is "are you allowed". This bug is purely an authorisation mistake.
Unauthenticated. Not logged in at all. An unauthenticated visitor is just someone with a browser and no account session.
Guest. A GitLab role with limited rights in a project. A Guest can see some things but not confidential issues.
Vulnerability class. This is a broken access control problem: the server hands out an object (here, the evidence file) without checking whether this particular requester may see what is inside it.
The setup
The researcher needed a project where the issue tracker is restricted, so that a person can see a release but not the issues behind it. The reproduction uses a public project with issues and merge requests restricted to project members only. The same steps were also confirmed to work for private projects, where Guest users who do not have access to confidential issues can reach them through the release evidence download.
No special tooling is described beyond the GitLab API and a private token for the setup calls, plus an unauthenticated browser session for the final request.
Finding it
The release evidence endpoint checks whether the user has access to a release, but it does not check the user's issue privileges. It never verifies access to the issue tracker of the project. As a result, any unauthorised user who can view the release but has no access to the issues can download the evidence data and obtain all associated issues. That includes the public but restricted issues and, more seriously, the confidential issues.
In everyday terms: the door to the release page is locked with the right key, but the cupboard behind it, full of private task notes, has no lock at all once you are through the door.
Exploitation, step by step
Step 1: create a public project with restricted issues
Create a public project and restrict issues and merge requests to project members only. This is the precondition that makes the leak meaningful: the project itself is visible, the issue tracker is not. Without this split, there would be nothing hidden to leak.
Step 2: create a milestone
Inside that public project, create a milestone, for example named My-Milestone. The milestone is what ties issues to the release.
Step 3: create a public issue on the milestone
Create a public issue and set its milestone to the milestone created in step 2.
Step 4: create a confidential issue on the milestone
Create a confidential issue and set its milestone to the same milestone.
Step 5: create a git tag
Create a git tag, for example named v1.0. The tag name is what the evidence URL will be built from.
Step 6: create the release through the API
Create a new release via the API with the milestone attached:
curl -X POST -H "Private-Token: <Private-Token>" https://example.gitlab.com/api/v4/projects/<project-id>/releases?tag_name=<v1.0>\&description=Public-release\&milestones[]=My-Milestone
Line by line:
curlis a command-line tool for sending web requests. It is the browser equivalent of typing an address, but for the API.-X POSTsays this request creates something new rather than just reading. Creating a release is a creation, so POST is used.-H "Private-Token: <Private-Token>"attaches the token header, proving which account is making the call. The angle brackets are a placeholder: the real token goes there, and it is a secret.https://example.gitlab.com/api/v4/projects/<project-id>/releasesis the endpoint for the releases of one project.<project-id>is the project's numeric identifier.?tag_name=<v1.0>sets which tag the release is for, matching step 5.\&description=Public-releasegives the release a description. The backslash before&is shell escaping so the ampersand is passed as part of the URL rather than treated as a command separator.\&milestones[]=My-Milestoneattaches the milestone from step 2. The[]notation means "a list", and here the list has one entry.
Step 7: fetch the evidence as an unauthenticated user
When the release is queried through the API, a new field evidence_file_path is returned, containing a URL to the evidence. As an unauthenticated user, visit that link, which has the form:
https://example.gitlab.com/<namespace>/<project-name>/-/releases/v1.0/evidence.json
Here <namespace> is the account or group that owns the project, <project-name> is the project's name, and v1.0 corresponds to the git tag. The important part is that this address is opened with no login at all: no token, no session, just a browser.
The response is JSON similar to the following:
{
"release": {
"id": 1,
"name": "My release",
"project": {
"id": 1,
"name": "My project",
"created_at": "2019-11-24T17:10:12.993Z",
"description": null
},
"tag_name": "v1.0",
"created_at": "2019-11-24T17:10:17.512Z",
"milestones": [
{
"id": 1,
"iid": 1,
"state": "active",
"title": "My-Milestone",
"issues": [
{
"id": 3,
"iid": 1,
"state": "opened",
"title": "My public issue",
"due_date": null,
"created_at": "2019-11-24T17:10:15.123Z",
"description": "This is a public issue",
"confidential": false
},
{
"id": 4,
"iid": 2,
"state": "opened",
"title": "Secret confidential issue, RCE",
"due_date": null,
"created_at": "2019-11-24T17:10:15.653Z",
"description": "This is a secret issue discussing a critical RCE vulnerability",
"confidential": true
}
],
"due_date": null,
"created_at": "2019-11-24T17:10:14.857Z",
"description": null
}
],
"description": "Public-release"
}
}
Reading it in plain words:
- The outer
releaseobject describes the release: itsid,name, theprojectit belongs to, thetag_name(v1.0), and when it wascreated_at. milestonesis a list of milestones attached to the release. Here there is one, titledMy-Milestone, with its ownid,iid(the number shown in the project's interface),stateand timestamps.- Inside that milestone,
issuesis the list of issues that belong to it. This is the leaked content. - The first issue has
title"My public issue", adescription, andconfidential: false, meaning it is an ordinary issue. - The second issue has
title"Secret confidential issue, RCE", adescriptionabout a critical RCE vulnerability, andconfidential: true. This is the one that should have been invisible to the requester.
The response leaks the issue titles and the description of the public issue, and, more critically, the title of the confidential issue, which is marked with confidential: true. The JSON response also leaks the milestone.
Confirmed example on GitLab.com
As an unauthorised user, visit the release page at https://gitlab.com/wter23/evidence-test. The side bar shows that the user has no access to the issue tracker: the interface itself confirms the visitor is not allowed to see the issues.
Then visit https://gitlab.com/wter23/evidence-test/-/releases/v1.0/evidence.json to retrieve the evidence payload. The response leaks the public and confidential issues, the git tag and the milestone. The contrast between the two visits is the whole finding: the interface says no, the download address says yes.
Root cause
The evidence endpoint checks access to the release but does not respect the user's issue privileges or check access to the project's issue tracker. The snapshot includes the issues attached to the milestone, confidential ones included, and the milestone data itself.
A useful comparison: a receptionist checks that you have a ticket for the building, then hands you the keys to every room inside without asking which rooms you are allowed into.
Impact
The evidence feature leaks public issues and confidential issues to unauthorised users who have no issue access, and it also leaks milestones. The researcher rates this as critical because confidential issues describe the most sensitive content inside a project. The described steps also work for private projects: Guest users, who do not have access to confidential issues, can reach them through the release evidence download. Anyone with access to the release page can download the evidence snapshot and thereby obtain the restricted issues, milestone data and git tag.
The expected behaviour is that if the user does not have access to the issues, the evidence snapshot cannot be downloaded.
Fix
The report does not describe a fix or a change that was made. The behaviour it asks for is that the evidence snapshot is not downloadable when the user lacks access to the issues.
Variants to test
- Private project with a Guest member: create a release on a milestone holding a confidential issue, then fetch the evidence URL as the Guest. A positive result is a JSON body containing the confidential issue's title and
confidential: true. - Public project with issues restricted to members: fetch the evidence URL with no session at all. A positive result is a JSON body with issue titles and descriptions that the anonymous user cannot see in the UI.
- A positive result is child data appearing for a user who cannot open the child in the UI.
Glossary
- API: a way for programs to talk to a website by sending requests to specific addresses and receiving structured data back.
- Authentication: proving who you are, for example by logging in or presenting a token.
- Authorisation: deciding whether an identified user is allowed to perform a particular action or see a particular object.
- Broken access control: a vulnerability where the server fails to check whether the requester is allowed to access something.
- Confidential issue: an issue hidden from most users, visible only to those with sufficient rights.
- curl: a command-line tool for sending web requests.
- Endpoint: one specific address on an API that performs one job.
- Evidence (release evidence): a downloadable snapshot collecting the issues attached to a release's milestone.
- Git tag: a label on a specific point in a project's code history, often a version number.
- Guest: a limited GitLab role that cannot see confidential issues.
- Header: extra information attached to a web request, such as a token or a requested format.
- Insecure direct object reference: a flaw where an object is handed out based on its address alone, without checking the requester's permission.
- JSON: a structured text format of names and values used to exchange data between programs.
- Milestone: a named batch that issues are assigned to, used to group work towards a release.
- Private project: a project visible only to invited users.
- Public project: a project anyone can see.
- Release: a published version of software, tied to a tag, with a description and optionally a milestone.
- RCE: remote code execution, a class of serious vulnerability where an attacker can run their own code on a server.
- Token: a secret string that proves identity when calling an API.
- Unauthenticated: not logged in, with no session or token.
- Vulnerability class: a category of security flaw, such as broken access control.