Users can download old project exports due to unclaimed namespace
When a user renames a namespace, the old namespace becomes available for another user to claim. An attacker can then download export files that the victim generated before the rename, exposing confidential project data.
- Triaged in 3 hours
- Fixed in 22 days
- Disclosed after 22 days
TL;DR: Happy new year and happy birthday, @douwem!
Vulnerability details
When a user renames its namespace, another user can claim the namespace and download old export files from the victim. The attack scenario here is that someone would scrape existing GitLab namespaces (users and groups, which are public) and see if they're renamed (freeing up the old namespace). The attacker can then claim the namespace the victim's old export files.
Impact
This may expose confidential project information, including the repository code, merge requests, issues, and snippets.
Proof of concept
Follow the steps below to reproduce the vulnerability.
As the victim
- Create a group called
test - Create a new private project in the
testgroup calledtest - Click the
Generate exportbutton in the project's settings page - Now rename the group to
new-test
As the attacker
- Create a group called
test(this is possible because the old group was renamed tonew-test) - Create a new private project in the
testgroup calledtest - Go to http://gitlab-instance/test/test/download_export
- Profit! The attacker will download the export file generated by the victim
Remediation
Expire download links when the namespace OR project URL changes. This vulnerability also applies when changing the project URL, although that is less severe. This might grant users access to private repositories, although far less likely than the PoC outlined in this report.
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 export download link is tied to the namespace path rather than a unique project identifier, so renaming the namespace leaves the old link valid for whoever claims the old name.
Impact
This may expose confidential project information, including repository code, merge requests, issues, and snippets.
What the attacker needed
Victim renames a namespace; victim generated an export before rename; attacker claims the old namespace
How it was found
- As the victim, create a group called test.
- Create a private project called test inside that group.
- Generate an export of the project.
- Rename the group to new-test.
- As the attacker, create a group called test.
- Create a private project called test inside the new group and visit the download_export URL to get the victim's export.
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 namespace is like a folder that holds projects. When someone renames their folder, the old name becomes free for anyone to take. If the victim had already made an export file (a backup of their project), the attacker who takes the old name can download that backup.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.