Skip to content
Access control Disclosed report Beginner

2FA not enforced on /api/v4/user/status

The 2FA enforcement for a group was not applied to the API endpoint that sets a user's status, so a user who had not completed 2FA could still update their status via that endpoint. An attacker with such an account could bypass the enforced second factor for that specific action.

GitLab

Originally disclosed on GitLab

  • Fixed in 5 months
  • Disclosed after 5 months

HackerOne report #953472 by brdoors3 on 2020-08-07, assigned to @jbroullon:

NOTE! Thanks for submitting a report! Please replace all the (parenthesized) sections below with the pertinent details. Remember, the more detail you provide, the easier it is for us to triage and respond quickly, so be sure to take your time filling out the report!

Summary

Hi team,

I found another endpoint vulnerable related to my other report #691477

1 access one group and enforce the 2FA for all users

In this test I used one grace period of 1 hour

2 after 1 hour access again https://gitlab.com

The user will be redirected to https://gitlab.com/profile/two_factor_auth

3 try to access all pages (this include the endpoint fixed on #691477) > the user is redirected to https://gitlab.com/profile/two_factor_auth

4 click on profile icon on top of page in right side

gitlab.PNG
gitlab.PNG From the original on GitLab

5 insert one new Status > set status

Response:

[REDACTED]

{"emoji":"speech_balloon","message":"hi","message_html":"hi"}

Vulnerable request:

PUT /api/v4/user/status HTTP/1.1
Host: gitlab.com
Connection: close
Content-Length: 27
Accept: application/json, text/plain, /
X-CSRF-Token: c[REDACTED] X-Requested-With: XMLHttpRequest
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36
Content-Type: application/json;charset=UTF-8
Origin: https://gitlab.com
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: https://gitlab.com/profile/two_factor_auth
Accept-Encoding: gzip, deflate
Accept-Language: pt-BR,pt;q=0.9,en-US;q=0.8,en;q=0.7
Cookie: __[REDACTED]

{"emoji":"","message":"hi"}

Impact

In this scenario the feature 'Enforcing 2FA for all users' is not correctly applied/enforced at PUT /api/v4/user/status HTTP/1.1

Attachments

Warning: Attachments received through HackerOne, please exercise caution!

[REDACTED]

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 API endpoint for updating user status did not check whether the user had completed enforced 2FA, unlike the web pages that redirected to the 2FA setup page.

What the attacker needed

A GitLab account; membership in a group that enforces 2FA; 2FA not yet set up (within grace period)

How it was found

  1. Access a group and enforce 2FA for all users, using a 1-hour grace period.
  2. After the grace period, access the site again; the user is redirected to the 2FA setup page.
  3. Try to access all pages; the user is redirected to the 2FA setup page.
  4. Click the profile icon and set a new status.
  5. Observe that the status update request succeeds despite 2FA not being completed.

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) adds a second step to logging in, like a code from your phone. A group can require all its members to use 2FA. This report shows that one part of the website still let a user who had not done the second step change their status message, so the requirement was not fully enforced.

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.

More from GitLab

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

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.