Skip to content
Info disclosure Disclosed report Beginner

2FA status of the members of groups/projects are leaked through the source code

The 2FA status of group members was exposed in the HTML source code of the group members page, visible to any user including logged-out visitors. An attacker could use this information to identify users without 2FA for targeted phishing or credential attacks.

GitLab

Originally disclosed on GitLab

  • Fixed in 5 months
  • Disclosed after 5 months
**[HackerOne report #1470023](https://hackerone.com/reports/1470023)** by `albatraoz` on 2022-02-03, assigned to @nmalcolm:

[Report](#report) | [Attachments](#attachments) | [How To Reproduce](#how-to-reproduce)

## Original Report

#####  Summary  
2FA status of the users is a confidential information and should be only visible to peopler that the user allows to. According to the group [permissions](https://docs.gitlab.com/ee/user/permissions.html) the 2FA status of the members of a group/project should be only visible to the owners/maintainers of the groups/projects & only they should be able to filter members on the basis of it. But the source code of the members list page is leaking the 2FA status of all the users.

<details>
<summary>Click here to view</summary>

#####  Steps to reproduce  
I've created a simple python script for easy reproduction:  
1.  Install dependencies  

```  
pip3 install beautifulsoup4  
```  

2. Create a python file with the following code  

```  
from bs4 import BeautifulSoup  
import requests  
import sys  
import json  
group_name = sys.argv[1]  
res = requests.get(f"https://gitlab.com/groups/{group_name}/-/group_members")  
data = res.content  
soup = BeautifulSoup(data, 'html.parser')  
div = soup.find("div", {"class": "js-group-members-list-app"})  
res = json.loads(div["data-members-data"])  
for member in res["user"]["members"]:  
	print(f'Username: {member["user"]["username"]}, 2FA Enabled: {member["user"]["two_factor_enabled"]}')  
```  

3. Run the python script with the group name for which you want to expose the 2FA status of.  

I've created a group for testing called 2fa_check, you can use it too.  

```  
python3 get_2fa_status.py 2fa2  
```  

4. You would see the 2FA status of the members of the group being printed.


{{media:0}}


You can check the same group as you are not member of the group but still you will get the results.

####  Impact

Two factor authentication is a confidential security related PII data of the members which should not be accessible to the anyone except the owners/maintainers of projects/groups. An attacker would be able to retrieve this information easily using this vulnerability.

## Attachments

**Warning:** Attachments received through HackerOne, please exercise caution!

* [Screenshot_from_2022-02-04_00-04-49.png](https://h1.sec.gitlab.net/a/d982ee4e-eb8d-41b0-9fd5-a6a5070068b0/Screenshot_from_2022-02-04_00-04-49.png)
* [get_2fa_status.py](https://h1.sec.gitlab.net/a/9610d115-e14b-44a6-b86d-28b4ad85fc48/get_2fa_status.py)

</details>

## How To Reproduce

1. Open browser of choice's Developer Tools (or use cURL)
1. As a logged out user, open any Group Members page for a public group. 
    1. N.b. also works for logged in users looking at any Group you're a member of, or as a logged in user looking at public groups that you're not a member of
1. Scroll through the server-provided response and look for a `div` with the class `js-group-members-list-app` (not the browser-rendered response)
1. View html encoded user deetz, incl. MFA status

In the below example, you see a signed out view of a public group, disclosing MFA status.


{{media:1}}


### TODO / Other vulnerable endpoints

�
 The Group Members API seems fine:

```
[{"id":24,"username":"victim","name":"Vic Tim","state":"active","avatar_url":"https://www.gravatar.com/avatar/cde15812b77a38321e6696050acb6d2c?s=80\u0026d=identicon","web_url":"http://gdk.test:3000/victim","access_level":50,"created_at":"2022-02-08T02:28:04.698Z","expires_at":null,"membership_state":"active"},{"id":8,"username":"jeff_collins","name":"Annita Weimann","state":"active","avatar_url":"https://www.gravatar.com/avatar/426f608516a49b9c7d5c78abc659c9cb?s=80\u0026d=identicon","web_url":"http://gdk.test:3000/jeff_collins","access_level":10,"created_at":"2022-02-08T02:46:20.063Z","expires_at":null,"membership_state":"active"},{"id":22,"username":"nm","name":"Nick Malcolm","state":"active","avatar_url":"http://gdk.test:3000/uploads/-/system/user/avatar/22/avatar.png","web_url":"http://gdk.test:3000/nm","access_level":10,"created_at":"2022-02-08T02:46:20.221Z","expires_at":null,"membership_state":"active"}]
```

❓ GraphQL API

❓ Projects Members page

❓ What else?

### Why is this happening?

I (@nmalcolm) think it's because the UI shows badges to owners/maintainers, but the page response is returning it to everyone. E.g. here's the AppSec team:


{{media:2}}


### Why is this bad?

Well, we say we only show this status to a certain Role, so it's at least a documentation update if intentional.

But as an attacker, being able to see which users (e.g. of a popular open source project) has MFA disabled means I know who to target in a phishing attack. Or if I have a list of breached passwords, I can more easily know which accounts to skip because MFA is protecting them.

The original report as published on GitLab. Images and videos are our own copies; raw HTML is shown as text. View it on GitLab.

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 server-side rendered page included the 2FA status for all viewers, even though the UI only intended to show it to owners/maintainers.

Impact

An attacker could see which users have MFA disabled, making them easier targets for phishing or credential-based attacks.

What the attacker needed

None

How it was found

  1. Open browser developer tools or use cURL.
  2. As a logged-out user, open any Group Members page for a public group.
  3. In the server-provided response, find the div with class js-group-members-list-app.
  4. View the HTML-encoded user details, including MFA status.

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.

Two-factor authentication (2FA) is an extra security step when logging in, like a code sent to your phone. This report found that a website was accidentally revealing which users had 2FA enabled and which did not, to anyone who looked at the page's underlying code. That information could help attackers choose easier targets.

What is Info disclosure?

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.

More from GitLab

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.