View the Starred Projects in a Private Profile
A private GitLab profile setting that should hide activity-related information did not prevent an API endpoint from exposing the user's starred projects. An attacker could view this information despite the profile being marked private.
- Triaged in 8 days
- Fixed in 15 months
- Paid in 3 months
- Disclosed after 16 months
Summary
It is possible to view the starred Projects in a private profile. Consider my profile for instance, https://gitlab.com/maruthi-adithya . This is a private profile and none of my account-related information should be leaked. However, https://gitlab.com/users/maruthi-adithya/starred.json exposes Starred Projects.
Steps to reproduce
- Login to Gitlab. Go to Settings.
- Check "Don't display activity-related personal information on your profiles".
- Save the Profile.
- Now, open your profile from a private window. It will say this is a private profile. However, the above mentioned API exposes the starred projects information.
Impact
According to the docs, https://gitlab.com/help/user/profile/index.md#private-profile, starred projects should be hidden. However, due to this API, it is getting exposed. Using this, an attacker could steal sensitive data from a private profile.
Context
GitLab lets each user decide how much of their activity is visible to others. One of the available controls is the setting "Don't display activity-related personal information on your profiles". When a user enables it, their profile becomes private: visitors see a notice that the profile is private instead of the account's activity-related information.
According to the GitLab documentation on private profiles, starred projects are among the items that should be hidden when this setting is on. The report shows that a JSON endpoint serving a user's starred projects did not respect that setting, so the data remained reachable even though the profile page itself was locked down.
Setup
No special tooling is needed. The precondition is a GitLab account whose owner has enabled the private-profile option, plus the ability to open the profile in a private browser window to confirm what an unauthenticated or unrelated visitor sees. The researcher used their own account, maruthi-adithya, as the test subject.
Finding it
The researcher compared two views of the same account. The profile page at:
https://gitlab.com/maruthi-adithya
is private and, as intended, does not reveal account-related information. But a second URL for the same user:
https://gitlab.com/users/maruthi-adithya/starred.json
returned the starred projects in JSON form. The profile page was protected while the JSON representation of the same data was not, which is the classic sign of an authorisation check applied in one code path but missing in another.
Exploitation
Step 1: Log in and open the settings
Log in to GitLab and go to Settings, where the profile visibility options live.
Step 2: Enable the private-profile option
Check the box labelled "Don't display activity-related personal information on your profiles".
Step 3: Save the profile
Save the Profile so the setting takes effect.
Step 4: Confirm the profile is private, then request the JSON endpoint
Open the profile from a private window. The page states that this is a private profile. Then request the starred projects endpoint for the same user:
https://gitlab.com/users/maruthi-adithya/starred.json
The endpoint returned the starred projects even though the profile was private. The username in the path is the only input the request needs.
Root cause
The private-profile setting is enforced on the profile page but not on the /users/<username>/starred.json endpoint. The endpoint takes the username directly from the URL and returns the associated starred projects without checking whether the profile owner has opted into hiding activity-related information. This is an insecure direct object reference: the object (the user's starred list) is addressed by a predictable identifier (the username) and the access control that should gate it is absent on this route. The report does not describe the server-side implementation, so the exact location of the missing check is not stated; it is likely a separate controller or serialiser path that was never wired to the privacy setting.
Impact
The documentation states that starred projects should be hidden on a private profile, but this API exposes them. The report frames the consequence as the ability to steal sensitive data from a private profile. The exposure is limited to the starred projects list; the report does not claim that other profile data is reachable through this endpoint.
Fix
The report does not describe the change that was made. A reasonable remedy would be to apply the private-profile check to the starred JSON endpoint as well.
Variants to test
- Other JSON or API representations of profile data: request the
.jsonform of activity, groups, projects or followers for a private profile and check whether any of them still return data. - Other users' identifiers: repeat the request with usernames other than your own to confirm the issue is not limited to the account you control.
- Unauthenticated access: send the request without a session to see whether the endpoint is reachable by anyone, not just logged-in users.
- Related privacy toggles: enable other visibility restrictions and check whether the corresponding endpoints honour them.
A positive result is any endpoint that returns the protected data for a profile that the UI presents as private.
Hunting notes
This kind of bug tends to hide wherever a product exposes the same object through more than one route: an HTML page, a JSON endpoint, an RSS or Atom feed, or an API path. During recon, look for alternate representations of profile pages (.json suffixes, /users/<name>/... paths) and compare what each returns for an account with restrictive privacy settings. The signal is a mismatch between what the UI shows a visitor and what a direct request returns.
To show enough impact, the researcher used their own account, turned the privacy setting on, confirmed the private-profile notice in a private window, and then demonstrated that the JSON endpoint still returned the starred projects. Tying the behaviour directly to the documented promise that starred projects are hidden made the gap between intended and actual behaviour explicit.
What happened, in plain words
GitLab is a website where people store and share code projects. Every user has a profile page, and every user can decide how much of that profile other people are allowed to see. One of the privacy switches is called "Don't display activity-related personal information on your profiles". When you tick it, your profile becomes private: anyone who visits it sees a short notice saying the profile is private, instead of your activity.
GitLab's own help pages say that when a profile is private, the projects you have starred should be hidden too. Starring a project is like bookmarking a page you like, so the list of starred projects can say a lot about what a person is interested in.
The researcher found that one particular address on the GitLab website still handed out that starred list, even for a private profile. The normal profile page was locked, but a second way of asking for the same information was not. This kind of mistake, where the same data is protected on one route and open on another, is very common and has a name: an insecure direct object reference, or IDOR.
The pieces you need to know
Before walking through the steps, here are the ideas the report relies on, explained from scratch.
- Profile: the public page a GitLab user has, at an address like
https://gitlab.com/<username>. It is roughly like a social media page: it shows who you are and what you have been doing on the site. - Starred projects: projects a user has marked with a star, the way you might bookmark a web page or "like" a post. The list is personal and reveals interests.
- Privacy setting: an option in your account settings that tells the site what other people may see. Turning it on is a promise from you to the site, and the site is expected to keep that promise everywhere.
- API: a way for a computer to ask a website for data directly, without loading the normal human-friendly page. Think of a restaurant: the dining room is the normal web page, and the kitchen door where you can ask for just the ingredients is the API. The same kitchen serves both, but the kitchen door sometimes forgets to check who is asking.
- JSON: a simple text format for data, made of names and values in curly braces. It is what an API usually replies with, and it is easy for a program to read. A
.jsonat the end of a web address is a strong hint that you will get JSON back instead of a web page. - Endpoint: one specific address on a website that does one specific job.
https://gitlab.com/users/<username>/starred.jsonis an endpoint whose job is to return a user's starred projects. - Private browser window: a window that does not use your logged-in session, so it behaves like a stranger visiting the site. It is the easiest way to check what other people actually see.
- IDOR (insecure direct object reference): a bug where a website lets you ask for a specific thing (an object) by naming it in the address, and forgets to check whether you are allowed to have it. If the name is easy to guess, such as a username, anyone can ask for anyone else's data.
Setting up the test
No special tools are needed. You only need a GitLab account, the ability to change its settings, and a private browser window to look at the result the way a stranger would. The researcher used their own account, maruthi-adithya, as the test subject, which is the safe and usual way to demonstrate a privacy bug: you prove it on data you own rather than on somebody else's.
Finding it
The researcher compared two addresses for the same account. The first is the ordinary profile page:
https://gitlab.com/maruthi-adithya
This is the page a person sees in their browser. With the privacy setting on, it correctly shows only the private-profile notice and does not reveal account-related information.
The second address asks for the same user's starred projects in JSON form:
https://gitlab.com/users/maruthi-adithya/starred.json
This one returned the starred projects. So the same data was protected on one route and open on another. That mismatch is the classic sign of a permission check that was written into one part of the code but forgotten in another.
Reproducing it step by step
Step 1: Log in and open the settings
Log in to GitLab and go to Settings. This is where the profile visibility options live. You go there because the bug only exists for accounts that have switched the privacy option on, so you first need to put your own account into that state.
Step 2: Enable the private-profile option
Tick the box labelled "Don't display activity-related personal information on your profiles". This is the switch that is supposed to hide your activity, including your starred projects, from other people.
Step 3: Save the profile
Save the Profile so the setting takes effect. Until you save, the change is only sitting in the form and the site has not been told about it.
Step 4: Confirm the profile is private, then request the JSON endpoint
Open your profile in a private browser window. Because that window is not logged in as you, it sees what any stranger sees, and the page states that this is a private profile. That confirms the setting is working on the normal page.
Then request the starred projects endpoint for the same user:
https://gitlab.com/users/maruthi-adithya/starred.json
Reading this address piece by piece:
https://gitlab.comis the GitLab website./users/says you are asking about a user.maruthi-adithyais the username, taken straight from the address./starred.jsonasks for that user's starred projects, in JSON format.
The endpoint returned the starred projects even though the profile was private. The username in the address is the only thing the request needs.
Why it happens
The private-profile setting is checked on the profile page but not on the /users/<username>/starred.json endpoint. The endpoint reads the username directly from the address and returns the starred projects without asking whether the owner has chosen to hide activity-related information.
That is an insecure direct object reference: the thing being requested (the user's starred list) is named by a predictable identifier (the username), and the permission check that should guard it is missing on this route. The report does not describe how the server is built, so the exact place where the check is missing is not stated. It is likely a separate piece of code that serves the JSON and was never connected to the privacy setting.
What an attacker could do
The documentation says starred projects should be hidden on a private profile, but this API exposes them. The report describes the consequence as the ability to steal sensitive data from a private profile. The exposure is limited to the starred projects list; the report does not claim that other profile data can be reached through this endpoint.
How it should be fixed
The report does not describe the change that was made. A reasonable remedy would be to apply the private-profile check to the starred JSON endpoint as well.
Other places worth checking
- Other JSON or API versions of profile data: ask for the
.jsonform of activity, groups, projects or followers for a private profile and see whether any of them still return data. - Other users' names: repeat the request with usernames other than your own, to confirm the problem is not limited to the account you control.
- Access without logging in: send the request with no session at all, to see whether the endpoint is reachable by anyone, not just by logged-in users.
- Related privacy switches: turn on other visibility restrictions and check whether the matching endpoints respect them.
A positive result is any endpoint that returns the protected data for a profile that the website presents as private.
How to look for this yourself
This kind of bug tends to hide wherever a product offers the same information through more than one route: a normal web page, a JSON endpoint, an RSS or Atom feed, or an API path. While exploring a site, look for alternate versions of profile pages (addresses ending in .json, or paths shaped like /users/<name>/...) and compare what each one returns for an account with strict privacy settings. The signal is a mismatch between what the website shows a visitor and what a direct request returns.
To show enough impact, the researcher used their own account, turned the privacy setting on, confirmed the private-profile notice in a private window, and then demonstrated that the JSON endpoint still returned the starred projects. Tying the behaviour directly to the documented promise that starred projects are hidden made the gap between what was intended and what actually happened clear.
Glossary
- API: a way for a program to ask a website for data directly, instead of loading the normal page meant for people.
- Endpoint: one specific web address that performs one specific job, such as returning a user's starred projects.
- IDOR (insecure direct object reference): a bug where a site lets you request a specific item by naming it in the address and fails to check that you are allowed to see it.
- JSON: a plain-text format for data, made of names and values, that programs can easily read.
- Private browser window: a browser window that does not use your logged-in session, so it sees the site as a stranger would.
- Private profile: a profile whose owner has switched on the setting that hides activity-related information from other people.
- Profile: the page on a website that describes a user and their activity.
- Starred projects: projects a user has marked with a star, similar to bookmarking or liking them.
- Username: the short name that identifies a user on the site, used in addresses such as
/users/<username>/starred.json.