Steal private objects of other projects via project import
A crafted GitLab project export could assign existing issues and merge requests from other projects to the imported project by including their database IDs in the export file. An attacker could then access private issues and merge requests belonging to other users by brute-forcing the incremental ID space.
- Triaged in 4 days
- Fixed in 7 days
- Paid in 4 days
- Disclosed after 2.5 years
Summary
An attacker could transfer issues, merge requests of another project to the imported project by importing a crafted GitLab export.
Steps to reproduce
- Import the attached tarball as GitLab export.
- Check the issues page of the imported project. You will see an private issue created by https://gitlab.com/nyangawa-h1 instead of the current user.
Description
The exploit is in project.json, I added one line to assign issue_ids and kept issues an empty array.
"issue_ids": [ 27422144 ],
"issues": [],
The issues_ids contains the database id of the issues the attacker wants to steal. There's no good way for the attacker to know the id of a specific issue, but as the id is incremental, the attacker could simply steal as many issues as possible in a brute forcing manner.
The root cause of this issue lies in project_tree_restorer.rb
...
@project.assign_attributes(project_params)
...
Many attributes (foreign key) like issue_ids and merge_request_ids are not excluded during import. According to my observation, affected objects including (but not limited to):
board_ids
issue_ids
merge_request_ids
note_ids
...
Looks like almost all non-excluded attributes behaves like issues are affected.
Examples

Output of checks
This bug happens on GitLab.com and self-hosted GitLab installations.
Impact
With this ability to modify relations between objects, an attacker could end up with accessing random resources of other users by traversing the incremental ID space.
Context
GitLab's project import feature lets a user recreate a project from an export archive. The archive is a tarball containing a project.json file that describes the project and its attributes, plus the associated data. When a user imports such an archive, GitLab restores the project and its relations from the values in project.json.
The report describes an insecure direct object reference in that restore path: by crafting the export, an attacker can make the imported project point at objects (issues, merge requests and others) that belong to other projects, including private ones. The researcher tested this on GitLab.com and states that self-hosted GitLab installations are affected too.
Setup
The report does not describe any special accounts, roles, tools or versions. The only precondition visible in the steps is the ability to import a GitLab export, which is a normal feature available to users. The attacker needs a crafted tarball; the researcher attached one to the report and refers to it as "the attached tarball".
Finding it
The researcher's observation is that the import restore code assigns attributes from project.json directly onto the project model, and that many foreign-key style attributes are not excluded from that assignment. Attributes such as issue_ids and merge_request_ids therefore survive the import and are applied to the new project. The researcher describes this as affecting "almost all non-excluded attributes" that behave like issues.
Exploitation
Step 1: Craft the export
The exploit lives in project.json. The researcher added one line to assign issue_ids while keeping issues as an empty array:
"issue_ids": [ 27422144 ],
"issues": [],
issue_ids holds the database IDs of the issues the attacker wants to pull into the imported project. Because issues is empty, the archive itself carries no issue content; the relation is established purely through the ID list.
Step 2: Import the tarball
The researcher's reproduction steps are:
- Import the attached tarball as GitLab export.
- Check the issues page of the imported project. You will see an private issue created by https://gitlab.com/nyangawa-h1 instead of the current user.
The result is that a private issue belonging to another user appears in the imported project, attributed to its original creator rather than to the importing user.

The screenshot shows the issues page of the imported project after the import, with the private issue present.
Step 3: Enumerate IDs
The attacker has no reliable way to learn the ID of a specific issue. However, because IDs are incremental, the attacker can simply steal as many issues as possible in a brute-forcing manner by supplying ranges of IDs.
Root cause
The root cause is in project_tree_restorer.rb, where the project attributes are assigned from the import parameters:
...
@project.assign_attributes(project_params)
...
Many attributes, in particular foreign keys such as issue_ids and merge_request_ids, are not excluded during import. The researcher lists the affected objects as including, but not limited to:
board_ids
issue_ids
merge_request_ids
note_ids
...
Because these attributes are not excluded during import, the imported project can be made to reference objects from other projects. The report does not describe any check that would have stopped this.
Impact
By modifying relations between objects, an attacker can end up accessing random resources of other users by traversing the incremental ID space. The researcher's list of affected attributes includes issues, merge requests, boards and notes. The impact applies on GitLab.com and on self-hosted installations. The report does not quantify how many objects could be reached or whether write access to the stolen objects was possible; it describes access to the resources.
Fix
Variants to test
- Other importers that restore relations from a JSON manifest: check whether ID lists for comments, notes, boards, milestones or labels are accepted and applied. A positive result is an imported project showing an object created by a different user.
- Other attributes in the same restorer beyond the listed ones: the researcher notes the list is not exhaustive, so any non-excluded foreign-key attribute is worth testing. A positive result is a relation to an object the importer does not own.
- Self-hosted instances: the researcher states the bug occurs there as well, so the same crafted archive can be used to confirm the behaviour outside GitLab.com.
Hunting notes
This kind of bug hides in import and export features, where a serialised manifest is trusted and applied to models. During recon, look for features that accept an archive and rebuild objects from it, and for parameters in the manifest that are ID lists or foreign keys. The signal is a restore path that calls a bulk attribute assignment without an explicit allow-list. To show impact, demonstrate that an object belonging to another user, such as a private issue, appears in the imported project; the researcher did this with a single crafted project.json and a screenshot of the resulting issues page.
What happened, in plain words
GitLab is a website where teams keep their code and track work. One of its features is project import: you can take a packaged copy of a project (an archive file) and ask GitLab to rebuild that project on its own servers. The archive contains a file called project.json, which is a plain text description of the project and its settings.
The researcher found that this rebuild step trusts the description too much. By editing one line in project.json, they could make the newly imported project point at issues that belong to somebody else, including private issues that the attacker should never be able to see. The imported project then shows those issues as if they were its own, still credited to their original author.
This kind of mistake has a name: an insecure direct object reference, or IDOR. The idea is simple. Imagine a hotel where every room key is just a number written on a card, and the front desk never checks whether the room is yours. If you write a different number on the card, you get into a different room. Here the "room number" is a database ID, and the "front desk" is the import code that never checks who owns the object behind that ID.
Background you need first
A few ideas come up again and again in this report, so here they are from zero.
Database ID. Every issue, merge request, comment and board in GitLab is stored in a database, and each row gets a number when it is created. These numbers are handed out in order: 1, 2, 3 and so on. That is what "incremental" means. It also means the numbers are guessable: if you know roughly when something was created, you can guess its number.
Foreign key. When one record in a database needs to point at another record, it stores that other record's ID. That stored ID is called a foreign key. An issue belonging to a project is linked by storing the project's ID on the issue, or by keeping a list of issue IDs on the project. Either way, the link is just a number.
Attribute. In the code that handles a project, each setting is called an attribute: its name, its visibility, and also lists like the IDs of its issues. When GitLab imports a project, it takes the values from project.json and copies them onto the new project. That copying step is where the bug lives.
Tarball. A tarball is a single file that bundles many files together, like a zip file. The export archive in this report is a tarball.
Brute forcing. Trying many possibilities in bulk instead of picking one carefully. If you do not know which ID holds an interesting issue, you try a whole range of IDs and see what comes back.
Self-hosted. GitLab.com is the version run by GitLab itself. A self-hosted installation is the same software run on a company's own servers. The researcher says the bug exists in both.
The setup
The report does not describe any special account, role, tool or version. The only thing the attacker needs is the ability to import a GitLab export, which is a normal feature any user can use. The attacker also needs a crafted tarball. The researcher attached one to the report and calls it "the attached tarball".
Finding it
The researcher looked at the code that rebuilds a project during import. That code takes the values from project.json and assigns them straight onto the project. Many of those values are foreign keys, lists of IDs pointing at other objects, and they are not on the list of things to skip during import. So a list like issue_ids or merge_request_ids written in the file is accepted and applied to the new project.
The researcher sums this up by saying it affects "almost all non-excluded attributes" that behave like issues.
Exploitation
Step 1: Craft the export
The whole trick sits in project.json. The researcher added one line that sets issue_ids, while leaving issues as an empty list:
"issue_ids": [ 27422144 ],
"issues": [],
Line by line:
"issue_ids": [ 27422144 ],is a setting that says: this project's issues are the ones whose database IDs appear in this list. Here the list holds a single number,27422144, which is the ID of an issue the attacker wants to pull in."issues": [],says the archive itself contains no issue content at all. The list is empty.
Put together, the archive carries no issue data, yet the project is told to point at an existing issue by its ID. The link is made purely through the number. This is the heart of the IDOR: the import trusts a number supplied by the attacker and never asks whether that issue belongs to the person doing the import.
Step 2: Import the tarball
The researcher's reproduction steps are:
- Import the attached tarball as GitLab export.
- Check the issues page of the imported project. You will see an private issue created by https://gitlab.com/nyangawa-h1 instead of the current user.
Step 1 is the normal import action: you upload the archive and GitLab rebuilds the project from it. Step 2 is the check. You open the issues page of the project you just created and look at what is there. The private issue of another user shows up, and it is still credited to its original creator rather than to the person who imported the project. That is the proof: an object the importer does not own has been pulled into their project.

The screenshot shows the issues page of the imported project after the import, with the private issue present.
Step 3: Enumerate IDs
The attacker has no reliable way to learn the ID of one particular issue. But because IDs are handed out in order, they do not need to. They can simply steal as many issues as possible in a brute-forcing manner, by putting ranges of IDs into the list and importing again. Some of those numbers will land on real issues, and those issues end up in the attacker's project.
Root cause
The root cause is in project_tree_restorer.rb, the file that rebuilds a project during import. There, the project's attributes are copied from the import parameters:
...
@project.assign_attributes(project_params)
...
Line by line:
@projectis the new project being built during the import.assign_attributes(project_params)takes the settings read from the archive and writes them onto that project in one go. Whatever is in the file is applied, including ID lists.
Many attributes, in particular foreign keys such as issue_ids and merge_request_ids, are not excluded during import. The researcher lists the affected objects as including, but not limited to:
board_ids
issue_ids
merge_request_ids
note_ids
...
Each line is a list of database IDs for a kind of object: boards, issues, merge requests and notes (comments). Because these lists are not excluded during import, the imported project can be made to reference objects from other projects. The report does not describe any check that would have stopped this.
Impact
By changing the relations between objects, an attacker can end up accessing random resources of other users by walking through the incremental ID space. The researcher's list of affected attributes includes issues, merge requests, boards and notes. This applies on GitLab.com and on self-hosted installations.
Fix
Variants to test
- Other importers that rebuild relations from a JSON description: check whether ID lists for comments, notes, boards, milestones or labels are accepted and applied. A positive result is an imported project showing an object created by a different user.
- Other attributes in the same restorer beyond the listed ones: the researcher notes the list is not exhaustive, so any non-excluded foreign-key attribute is worth testing. A positive result is a relation to an object the importer does not own.
- Self-hosted instances: the researcher states the bug occurs there as well, so the same crafted archive can be used to confirm the behaviour outside GitLab.com.
Hunting notes
This kind of bug hides in import and export features, where a packaged description of a project is trusted and applied to the database. During recon, look for features that accept an archive and rebuild objects from it, and for settings in that description that are lists of IDs or foreign keys. The signal is a rebuild step that copies many attributes at once without an explicit allow-list of which ones are safe. To show impact, demonstrate that an object belonging to another user, such as a private issue, appears in the imported project. The researcher did this with a single crafted project.json and a screenshot of the resulting issues page.
Glossary
- API: a way for one piece of software to talk to another, sending requests and getting structured answers back.
- Attribute: a single setting or field on a record, such as a project's name or the list of its issue IDs.
- Brute forcing: trying many possibilities in bulk, for example a whole range of IDs, instead of guessing one.
- Database ID: the number a database gives each stored record when it is created, usually in increasing order.
- Export: a packaged copy of a project, produced by GitLab, that can later be imported to rebuild it.
- Foreign key: a stored ID that points at a record in another table, used to link objects together.
- GitLab: a website and software for hosting code and tracking work such as issues and merge requests.
- IDOR (insecure direct object reference): a bug where a program uses an ID supplied by the user to fetch an object without checking that the user is allowed to see it.
- Import: the feature that rebuilds a project from an export archive.
- Incremental: handed out in order, one after another, so the next number is easy to guess.
- Issue: a task, bug report or discussion item tracked inside a project.
- Merge request: a request to merge one set of code changes into another, used for review in GitLab.
- Note: a comment attached to an issue, merge request or other object.
- Private: visible only to the people who are allowed to see it, not to the public.
- Project: a container in GitLab holding code and its related issues, merge requests and boards.
project.json: the plain text file inside an export that describes the project and its settings.project_tree_restorer.rb: the code file that rebuilds a project during import.- Self-hosted: the same software run on a company's own servers rather than on the vendor's website.
- Tarball: a single file bundling many files together, like a zip archive.