# Steal private objects of other projects via project import

Crafted GitLab project export with issue_ids in project.json reassigned other projects' private issues to attacker's imported project via mass-assignment in project_tree_restorer.

- Payout: $20,000
- Severity: critical
- Program: GitLab
- Found by: saltyyolk
- Disclosed: 2022-06-07
- Write-up quality: 8/10
- Original: https://hackerone.com/reports/743953
- Library page: https://bugbountylibrary.com/r/h1%3A743953
- Tags: area:web domain:web impact:data-leak impact:pii-leak kind:bounty platform:hackerone sev:critical tech:ruby technique:source-review vuln:access-control vuln:idor

**Target:** GitLab project import (project_tree_restorer.rb, project.json)
**Root cause:** Project import calls assign_attributes(project_params) without excluding foreign-key attributes like issue_ids, merge_request_ids, note_ids, board_ids, allowing attacker-controlled relation reassignment.
**Steps:**
1. Craft a GitLab export tarball with project.json containing `"issue_ids": [27422144]` and `"issues": []`.
2. Import the tarball as a GitLab project export.
3. Visit the imported project's issues page; the private issue with DB id 27422144 now appears, owned by another user.
4. Brute-force incremental IDs to harvest many private issues/MRs/notes.
**How found:** Researcher inspected project_tree_restorer.rb, noticed assign_attributes(project_params) with no exclusion of foreign-key attributes, hypothesized issue_ids could be set via project.json, and confirmed by importing a tarball with issue_ids populated and issues empty.
**Exploitation:** Attacker imports a crafted export where project.json sets issue_ids (and similar FK arrays) to target DB IDs. Import assigns these relations to the attacker's project, granting read access to private issues/MRs/notes of other projects. Incremental IDs allow enumeration across the ID space.
**Escalation:** Enumerate incremental IDs to mass-harvest private objects across many projects; same primitive applies to merge_request_ids, note_ids, board_ids.
**Insight:** On import/restore features, audit which model attributes are mass-assigned from attacker-supplied manifests; FK arrays like *_ids are commonly overlooked and let you rebind relations to arbitrary DB IDs.

## Proof of concept (copied exactly from the original report)

**Crafted project.json with issue_ids and empty issues**

```
"issue_ids": [ 27422144 ],                                                 
    "issues": [],
```

**Root cause assign_attributes in project_tree_restorer.rb**

```
@project.assign_attributes(project_params)
```

