Able to list personal snippets of a user through GraphQL even If the user has set the profile to private
A private profile should hide snippets, but GraphQL still listed a user's snippets by username, exposing their IDs and allowing access.
GitLab
Originally disclosed on GitLab
- Fixed in 2 months
- Disclosed after 2 months
HackerOne report #1090825 by albatraoz on 2021-01-30, assigned to @rchan-gitlab:
Report | Attachments | How To Reproduce
Report
Summary
According to the documentation when a user sets his profile as private, other users won't be able to see the profile information which includes snippets too.
But these snippets can accessed using Graphql for a specific user even If the user has set his profile to private using the grpahql [explorer] (https://gitlab.com/-/graphql-explorer)
Steps to reproduce
- Create snippets from a victim's account & set the profile as private from settings.
- Now open an incognito tab & go to the graphql [explorer] (https://gitlab.com/-/graphql-explorer)
- Paste the following query & hit enter.
query {
user(username:"<victim_username>"){
snippets {
edges {
node {
id
}
}
}
}
}
Now you can see all the snippets of the user & can access them with their id using https://gitlab.com/-/snippets/<snippet_id>
POC
Let's use my account for a quick POC
- Go to my account , you will see that I have a private profile with no snippets tab.
- Now go to the graphql [explorer] (https://gitlab.com/-/graphql-explorer)
- Paste the following query & hit enter.
query {
user(username:"adarshshetty18"){
snippets {
edges {
node {
id
}
}
}
}
}
You will be able to list all my snippets even If my profile is private
.png)
Impact
Even If the public snippets are available for access to everyone, the ability to list snippets of a particular user breaks the protection set by the user to make his profile information private. It leads to exposure of the snippets of a specific user.
Attachments
Warning: Attachments received through HackerOne, please exercise caution!
How To Reproduce
Please add reproducibility information to this section:
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the GraphQL user resolver for snippets did not enforce the same privacy checks as the web interface.
Impact
The privacy setting was bypassed, exposing the existence and IDs of a user's snippets, which could then be accessed directly.
What the attacker needed
Victim has a private profile with snippets; attacker knows the victim's username; access to GraphQL explorer
How it was found
- Create snippets from a victim's account and set the profile as private.
- Open an incognito tab and go to the GraphQL explorer.
- Paste a query that requests the user's snippets by username and run it.
- Observe the list of snippet IDs returned.
- Access each snippet using its ID via the snippets URL.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
When your profile is private, you expect your snippets to be hidden. However, GraphQL did not check this setting and returned the list of snippets anyway, so anyone could see their IDs and open them.
What is IDOR?
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.