Group export leaks private email addresses of all users of a GitLab instance
The group export feature included each member's email address in the exported archive even when the user had set their email to private. A malicious user could create a group, add any user to it, export the group, and read that user's private email address.
GitLab
Originally disclosed on GitLab
- Fixed in 20 months
- Disclosed after 20 months
HackerOne report #765201 by xanbanx on 2019-12-27, assigned to @ankelly:
Hi GitLab security team,
Summary
GitLab recently added the ability to export groups. Maintainers can perform this action and download the exported group in form of an archive. Furthermore,
GitLab users can set their email to private thus these email addresses should not be leaked to other users. However, the new group export does not respect this setting. The private user email is leaked via the group export feature. Thus a malicious user can abuse this feature, add people to the group, and then get their private email address.
Steps to reproduce
- Create a new group
- Add some users, which set their email address to private, to the group
- Export the the group by calling:
curl -X POST --header "PRIVATE-TOKEN: Token" https://example.gitlab.com/api/v4/groups/<id>/export - Download the exported group via
curl --header "PRIVATE-TOKEN: Token" https://example.gitlab.com/api/v4/groups/<id>/export/download -o group.tar.gz - Extract the archive and inspect the containing
group.json. Here you will find a members section like the one below, which leaks the private email address of all members.
...
"members": [
{
"id": 1,
"access_level": 10,
"source_id": 2,
"source_type": "Namespace",
"user_id": 23,
"notification_level": 3,
"created_at": "2019-12-27 17:45:04 UTC",
"updated_at": "2019-12-27 17:45:04 UTC",
"created_by_id": 1,
"invite_email": null,
"invite_token": null,
"invite_accepted_at": null,
"requested_at": null,
"expires_at": null,
"ldap": false,
"override": false,
"user": {
"id": 23,
"email": "[email protected]",
"username": "foo"
}
},
...
]
Impact
This vulnerability leaks the private email address of users. A malicious user can simply create a group and then add all users of a Gitlab instance, or even on gitlab.com, the group and then export it to get their private email address.
What is the current bug behavior?
The group export leaks the private email address of any user.
What is the expected correct behavior?
The group export feature should not leak the private email address of users.
Output of checks
This bug happens on GitLab.com, running on GitLab Enterprise Edition 12.7.0-pre 7ed33754ed4
Best regards,
Xanbanx
Impact
See above.
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 export serialised the full user record for each member without applying the privacy setting that hides email addresses.
Impact
Private email addresses of users could be disclosed to any user who can add them to a group and export it, including on GitLab.com.
What the attacker needed
A GitLab account able to create a group; ability to add the target user to the group; API access token
How it was found
- Create a new group.
- Add users who have set their email to private to the group.
- Trigger the group export through the API.
- Download the exported archive through the API.
- Extract the archive and inspect the group JSON file, which contains the members' email addresses.
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.
GitLab lets users hide their email address so other people cannot see it. A new feature that exports a group to a downloadable file included the hidden email addresses anyway. Anyone who could add a person to a group they control could then download the file and read that person's private email.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.