File template project ID exposed from public groups through group API
A private project's numeric ID was exposed through a public group's API response when that project was set as the group's file template. An attacker could learn the ID of a private project, which might aid further attacks if other vulnerabilities allow project name enumeration.
GitLab
Originally disclosed on GitLab
- Fixed in 12 months
- Disclosed after 12 months
HackerOne report #549505 by ashish_r_padelkar on 2019-04-27, assigned to estrike:
Summary
Hello,
Very low severity issue but i think this need fixing as this exposes the private project ID if it is set as template in public group.
For eg, there is a option in group where you can set a immediate projects as its template in group settings

If this is a public group which sets a private project in above settings, the ID of this private project is exposed publicly using group API endpoint https://gitlab.com/api/v4/groups/<PublicGroupID>
You will find the file_template_project_id parameter in the response
Steps to reproduce
- Create a public group
- Create a private project underneath
- Set this project as template for this group in group settings
- When any user navigates to this public group, they wont see any projects underneath because its a private project.
- Now use a Group API endpoint
https://gitlab.com/api/v4/groups/<PublicGroupID> - See the response, you will find the private project ID as
file_template_project_id
Examples POC
You can use this group for POC https://gitlab.com/PrivateGroupofGuest.
You wont see any projects in it but there are private projects in it
Now, Use this https://gitlab.com/api/v4/groups/3721877 .
See the response and find file_template_project_id which is private project ID set as template in this group.
What is the current bug behavior?
Private project ID is exposed if it is set as template in group
What is the expected correct behavior?
Users without permissions to projects shouldnt see this ID populated in the file_template_project_id parameter in API response!
Output of checks
This bug happens on GitLab.com and might be on omnibus installations too!
Regards,
Ashish
Impact
While this may not be impactful currently as it only exposes ID but it need fixing. Also, if there are any other vulnerabilities which allows oracle of project names based on ID, this might be useful for valid attack scenario.
Attachments
Warning: Attachments received through HackerOne, please exercise caution!
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 group API endpoint does not filter the file_template_project_id field based on the requester's permissions to the referenced project.
Impact
The exposure is low severity as it only reveals a numeric ID, but it could be useful if other vulnerabilities allow project name enumeration.
What the attacker needed
A public group; a private project set as group template; no authentication needed
How it was found
- Create a public group
- Create a private project underneath
- Set this project as template for this group in group settings
- When any user navigates to this public group, they wont see any projects underneath because its a private project
- Now use a Group API endpoint `https://gitlab.com/api/v4/groups/<PublicGroupID>`
- See the response, you will find the private project ID as `file_template_project_id`
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.
A private project is meant to be hidden. If a public group uses it as a template, the group's API response includes its ID number, though nothing else about the project is shown.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.