Know whether private project name exists or not within a group using link comments
A user could determine whether a private project exists within a group by posting a comment with a link to a guessed project path and observing the link's hover preview. If the project exists, the link was rewritten to the current project's path; if not, the original link remained.
Originally disclosed on HackerOne
- Triaged in 13 days
- Fixed in 4 months
- Paid in 4 months
- Disclosed after 8 months
Summary: Hello,
It is possible for anyone to know if private project exists or not in public/private groups if they can guess the project names correctly.
Description: Using markdown feature, we can form a comment which will allow us to know if the private project is exists within a group or not.
Steps To Reproduce:
-
As any user, go to any issue/merge request and select the comment box
-
Select the link which will appear like
[](url) -
Now if you know the group name, just make a guess of the private project that may exists within that group. Lets say
PublicGroupcontains aPrivateProjectbut this user doesnt have any access toPrivateProject. -
This user can still know that this project exists if the user guess this name correctly
-
Just form a url like
[Click](https://gitlab.com/PublicGroup/PrivateProject/issues/1)and comment. -
Now hover over the Click link text. Notice the status bar (bottom left) of your browser. This will show you the link of your currect project with /click appended to the url.
-
Now just make a wrong guess
[Click](https://gitlab.com/PublicGroup/PrivateProject1/issues/2). -
Now hover over again on Click link text and you will notice that the wrong link shows in the browser status bar as it is.
-
So we can say, if we can guess the project name correctly, it shows current project link.
-
If we guess it wrong, the link appears as it is.
-
So the conclusion is, if link appears as it is on browser status bar, project DOES NOT exists in the group. If link appears of current project, then project Exists in the group!
Regards, Ashish
Impact
Know whether private project name exists within a group or not
Context
GitLab is a web based DevOps platform where users organise work into groups and projects. A project can be public or private, and a private project inside a group is only meant to be visible to members who have been granted access to it. The report looks at a markdown feature that is available to any user: the comment box on issues and merge requests, where markdown links can be written and rendered.
The claim is narrow and specific: by writing a markdown link that points at a guessed project path inside a known group, a user with no access to that project can learn whether the private project exists. The weakness is classified as information disclosure and rated low severity.
Setup
The report does not describe any special accounts, roles, tools or versions. The only precondition it states is that the attacker knows the name of the group and can make a guess at the name of a private project inside it. The attacker is described as any user who does not have access to the private project in question.
Finding it
The report shows that the way GitLab renders a markdown link depends on whether the link target resolves to a project the current user can see. When the target is a project the user has access to, the rendered link is rewritten to point at the current project with /click appended. When the target does not resolve, the link is left exactly as written. That difference in the rendered output is enough to answer a yes or no question about the existence of a private project, without any access to it.
Exploitation
Step 1: Open a comment box
As any user, go to any issue or merge request and select the comment box. This is the ordinary markdown editor available to any user on the instance.
Step 2: Insert a link placeholder
Select the link option, which inserts a placeholder that looks like this:
Step 3: Guess a private project inside a known group
Assume a group called PublicGroup contains a project called PrivateProject, and that the user has no access to PrivateProject. The user can still test whether that project exists by guessing its name.
Step 4: Write the guessed link and comment
Form a URL pointing at an issue in the guessed project and post the comment:
[Click](https://gitlab.com/PublicGroup/PrivateProject/issues/1)
Step 5: Hover over the link
Hover over the Click link text. The status bar at the bottom left of the browser shows the link of the current project with /click appended to the URL. That rewritten target is the signal that the guessed project resolved.
Step 6: Make a wrong guess
Now post a comment with a deliberately wrong project name:
[Click](https://gitlab.com/PublicGroup/PrivateProject1/issues/2)
Step 7: Hover again
Hover over the Click link text again. This time the wrong link is shown in the browser status bar exactly as it was written.
Step 8: Read the result
The researcher's conclusion is a simple rule:
- If the link appears as it is in the browser status bar, the project does not exist in the group.
- If the link appears as the current project, the project exists in the group.
Root cause
The report does not describe the code or the design decision behind the behaviour. What it shows is that link rendering treats a resolvable project path differently from an unresolvable one, and that this difference is observable by any user who can post a comment. The rendered link therefore answers a question about a private project that the commenting user is not authorised to see.
Impact
An attacker who knows a group name can confirm whether a guessed private project name exists inside that group. The report frames the impact exactly that way: knowing whether a private project name exists within a group. It does not claim access to the project, its contents, its members or its issues. The technique depends on guessing the project name correctly, so it is a confirmation oracle rather than a discovery mechanism on its own.
Fix
Based on the behaviour described, the fix would be to make the link rendering decision independent of whether the target project exists for users who cannot access it, so that a resolvable private project and a non-existent project produce the same rendered output.
Variants to test
- Try the same guessed-link technique against other markdown surfaces, such as issue descriptions, merge request descriptions and wiki pages, and check whether the status bar rewrite behaves the same way. A positive result is the same split between a rewritten link and an unchanged link.
- Try links to other object types inside a private project, such as merge requests or other paths under the project, and compare the rendered output. A positive result is any object path that reveals project existence through the same rewrite.
- Try guessing private group names rather than project names, using a link that points into the group. A positive result is a rewrite that differs between an existing private group and a non-existent one.
- Try the technique from an account with no membership in the group at all, to confirm the behaviour does not depend on any shared access. A positive result is the same signal from a fully unaffiliated account.
Hunting notes
This kind of bug hides in features that resolve user supplied references against server side objects and then reflect the result back to the user. Markdown link rendering, autocomplete, mention handling and any preview endpoint are good places to look, because they often perform an existence check before deciding how to render. The signal during recon is a rendered link or reference whose final form changes depending on whether the target exists, which can be spotted by comparing a known-good target with a deliberately wrong one. The researcher demonstrated impact by showing a difference in the browser status bar between a correct and an incorrect guess, which turns a rendering detail into a yes or no answer about a private project.
What happened, in plain words
GitLab is a website where teams keep their work. Inside GitLab, work is organised into groups (think of a group as a folder for a team) and projects (think of a project as a single piece of work, such as a code repository, inside that folder). A project can be public, meaning anyone can see it, or private, meaning only the people who have been given access can see it.
The researcher found a small trick. Any logged-in user can write a comment on an issue or a merge request (GitLab's pages for discussing work). In those comments you can write a link using a simple text format called markdown. When GitLab displays the comment, it turns that text into a clickable link.
The trick is this: GitLab treats a link differently depending on whether the thing it points at exists and is visible to you. If the link points at a project you can see, GitLab quietly rewrites the link to point at the current project with /click added to the end. If the link points at something that does not exist, GitLab leaves the link exactly as you wrote it. By hovering over the link and looking at the browser's status bar, you can tell which of the two happened. That tells you whether a private project with the name you guessed exists inside a group whose name you already know.
The report calls this information disclosure: a bug where the system leaks a small piece of information it should have kept hidden. Here the leaked information is only "this private project name exists" or "it does not". The report rates it low severity, because it does not give access to the project itself, only a yes or no answer about its name.
Context
GitLab is a web based DevOps platform, which is a fancy way of saying it is a website where software teams plan, write, review and ship their work. Users organise that work into groups and projects. A project can be public or private, and a private project inside a group is only meant to be visible to members who have been granted access to it.
The report looks at a markdown feature available to any user: the comment box on issues and merge requests, where markdown links can be written and rendered.
A quick word on markdown. Markdown is a lightweight way of writing formatted text using plain characters. For example, wrapping a word in asterisks makes it bold, and writing square brackets followed by round brackets creates a link. The square brackets hold the text you see, and the round brackets hold the address the link points to. GitLab converts that plain text into real HTML (the language web pages are made of) when it shows your comment.
The claim in the report is narrow and specific: by writing a markdown link that points at a guessed project path inside a known group, a user with no access to that project can learn whether the private project exists. The weakness is classified as information disclosure and rated low severity.
Setup
The report does not describe any special accounts, roles, tools or versions. The only precondition it states is that the attacker knows the name of the group and can make a guess at the name of a private project inside it. The attacker is described as any user who does not have access to the private project in question.
In other words, you do not need to be an administrator and you do not need any special software. You only need a normal GitLab account, a browser, and a guess.
Finding it
The report shows that the way GitLab renders a markdown link depends on whether the link target resolves to a project the current user can see. When the target is a project the user has access to, the rendered link is rewritten to point at the current project with /click appended. When the target does not resolve, the link is left exactly as written. That difference in the rendered output is enough to answer a yes or no question about the existence of a private project, without any access to it.
Why does this matter? Because the rewrite is a side effect of an internal check: "does this path point at a real project?" If the answer is yes, GitLab changes the link. If the answer is no, it does not. That check is being performed on a private project the user is not allowed to see, and the result of the check is visible to the user through the rendered link. The user never sees the project, but they see the answer to the question.
Exploitation
Step 1: Open a comment box
As any user, go to any issue or merge request and select the comment box. This is the ordinary markdown editor available to any user on the instance.
An issue is a page where a team tracks a task, a bug or a feature request. A merge request is a page where someone proposes changes to the code and others review them. Both have a comment box at the bottom, and both accept markdown.
Step 2: Insert a link placeholder
Select the link option, which inserts a placeholder that looks like this:
Line by line: the empty square brackets [] are where the visible link text goes. The round brackets (url) are where the address goes, with url acting as a placeholder word that you replace. The editor inserts this skeleton so you do not have to remember the syntax. You then fill in the two parts yourself.
Step 3: Guess a private project inside a known group
Assume a group called PublicGroup contains a project called PrivateProject, and that the user has no access to PrivateProject. The user can still test whether that project exists by guessing its name.
This is the heart of the technique. The attacker already knows the group name. What they do not know is whether a particular private project exists inside it. They form a guess, and the next steps let them check the guess.
Step 4: Write the guessed link and comment
Form a URL pointing at an issue in the guessed project and post the comment:
[Click](https://gitlab.com/PublicGroup/PrivateProject/issues/1)
Line by line: [Click] is the text that will appear in the comment, so the reader sees the word "Click". (https://gitlab.com/PublicGroup/PrivateProject/issues/1) is the address the link points to. Reading the address from left to right: https:// means a secure web connection, gitlab.com is the GitLab website, PublicGroup is the group name, PrivateProject is the guessed project name, issues means the issues section of that project, and 1 is the number of a specific issue.
Step 5: Hover over the link
Hover over the Click link text. The status bar at the bottom left of the browser shows the link of the current project with /click appended to the URL. That rewritten target is the signal that the guessed project resolved.
The status bar is the strip at the bottom of the browser window. When you move your mouse over a link without clicking it, most browsers show the link's destination there. This is a normal browser feature, not something GitLab controls. The status bar reveals the address GitLab actually put into the link, which is not always the address that was written in the comment.
So if the status bar shows a different address than the one written, ending in /click, that means GitLab recognised the project path and rewrote the link. Recognition means the project exists.
Step 6: Make a wrong guess
Now post a comment with a deliberately wrong project name:
[Click](https://gitlab.com/PublicGroup/PrivateProject1/issues/2)
Line by line: this is the same structure as before, but the project name is now PrivateProject1 (with a 1 on the end) and the issue number is 2. The 1 on the end is the deliberate mistake: the attacker is pretending the project is called something slightly different, to see what happens when the guess is wrong.
Step 7: Hover again
Hover over the Click link text again. This time the wrong link is shown in the browser status bar exactly as it was written.
No rewrite happened. GitLab did not recognise PrivateProject1 as a real project, so it left the link alone. The status bar shows the address the attacker typed, unchanged.
Step 8: Read the result
The researcher's conclusion is a simple rule:
- If the link appears as it is in the browser status bar, the project does not exist in the group.
- If the link appears as the current project, the project exists in the group.
That is the whole trick. Two comments, two hovers, and a comparison of what the status bar shows. The difference between the two outcomes is the answer to the question "does this private project exist?"
Root cause
What it shows is that link rendering treats a resolvable project path differently from an unresolvable one, and that this difference is observable by any user who can post a comment. The rendered link therefore answers a question about a private project that the commenting user is not authorised to see.
In plain terms: the system asks "does this project exist?" and then acts on the answer in a way the user can see. The leak is not the project's contents; it is the answer to a yes or no question.
Impact
An attacker who knows a group name can confirm whether a guessed private project name exists inside that group. The report frames the impact exactly that way: knowing whether a private project name exists within a group. It does not claim access to the project, its contents, its members or its issues. The technique depends on guessing the project name correctly, so it is a confirmation oracle rather than a discovery mechanism on its own.
A confirmation oracle is a way of checking a guess: you supply a guess and the system tells you yes or no. It does not tell you the answer from scratch. If you have no idea what the project might be called, this technique will not help you find it. But if you have a shortlist of likely names, you can test each one and learn which exist.
Fix
Based on the behaviour described, the fix would be to make the link rendering decision independent of whether the target project exists for users who cannot access it, so that a resolvable private project and a non-existent project produce the same rendered output.
In other words: if you are not allowed to see a project, the link should look the same whether the project is there or not. That way the rendering gives away nothing.
Variants to test
- Try the same guessed-link technique against other markdown surfaces, such as issue descriptions, merge request descriptions and wiki pages, and check whether the status bar rewrite behaves the same way. A positive result is the same split between a rewritten link and an unchanged link.
- Try links to other object types inside a private project, such as merge requests or other paths under the project, and compare the rendered output. A positive result is any object path that reveals project existence through the same rewrite.
- Try guessing private group names rather than project names, using a link that points into the group. A positive result is a rewrite that differs between an existing private group and a non-existent one.
- Try the technique from an account with no membership in the group at all, to confirm the behaviour does not depend on any shared access. A positive result is the same signal from a fully unaffiliated account.
These variants are worth trying because the underlying pattern (check whether something exists, then render differently) may appear in more than one place. Each variant asks the same question in a slightly different spot.
Hunting notes
This kind of bug hides in features that resolve user supplied references against server side objects and then reflect the result back to the user. Markdown link rendering, autocomplete, mention handling and any preview endpoint are good places to look, because they often perform an existence check before deciding how to render. The signal during recon is a rendered link or reference whose final form changes depending on whether the target exists, which can be spotted by comparing a known-good target with a deliberately wrong one. The researcher demonstrated impact by showing a difference in the browser status bar between a correct and an incorrect guess, which turns a rendering detail into a yes or no answer about a private project.
A preview endpoint is a feature that shows you what your text will look like before you post it. It is a common place for this kind of leak, because the server has to process your text and send back a rendered result, and that result may depend on things you are not allowed to see. Autocomplete is the drop-down list of suggestions that appears as you type, for example when you type @ to mention a user or # to reference an issue. It also has to check what exists before suggesting it, so it is worth testing in the same way.
Glossary
- Markdown: a lightweight way of writing formatted text with plain characters, such as
[text](url)for a link. - Group: a container in GitLab that holds projects, usually representing a team or an organisation.
- Project: a single piece of work in GitLab, such as a code repository, that lives inside a group.
- Private project: a project that only users who have been granted access can see.
- Public project: a project that anyone can see.
- Issue: a GitLab page for tracking a task, bug or feature request.
- Merge request: a GitLab page where someone proposes code changes and others review them.
- Comment box: the text area at the bottom of an issue or merge request where users write replies, and which accepts markdown.
- Render: to convert written text into the formatted output a browser displays, for example turning markdown into HTML.
- HTML: the language web pages are written in.
- URL: the address of a page on the web, such as
https://gitlab.com/PublicGroup/PrivateProject/issues/1. - Status bar: the strip at the bottom of a browser window that shows a link's destination when you hover over it.
- Hover: to move the mouse pointer over something without clicking.
- Information disclosure: a bug where a system leaks information it should have kept hidden.
- Severity: a rating of how serious a bug is, often from low to critical.
- Confirmation oracle: a way of checking a guess, where the system tells you yes or no but does not reveal the answer on its own.
- Root cause: the underlying reason a bug exists, as opposed to its visible symptom.
- Preview endpoint: a feature that shows what your text will look like before you post it.
- Autocomplete: the drop-down list of suggestions that appears as you type, based on what exists on the server.
- Recon: short for reconnaissance, the early phase of looking around a system to find things worth testing.
- DevOps platform: a website where software teams plan, write, review and ship their work.