Skip to content
Access control Disclosed report Beginner

Bypassing "Restrict access by IP address" to view snippets names of the restricted group projects

A group member could view the names of private snippets in a project whose group was restricted by IP address, by visiting the owner's public profile snippets tab from a non-allowed IP. This bypassed the intended restriction that all project resources be hidden from other IP addresses.

GitLab

Originally disclosed on GitLab

  • Fixed in 3 months
  • Disclosed after 3 months

⚠️ Please read the process on how to fix security issues before starting to work on the issue. Vulnerabilities must be fixed in a security mirror.

HackerOne report #2755911 by mateuszek on 2024-10-02, assigned to @ngeorge1:

Report | How To Reproduce

Report

1. Description:
As I can read in Gitlab docs about "Restrict group access by IP address":
(https://docs.gitlab.com/ee/user/group/access_and_permissions.html#restrict-group-access-by-ip-address)
I can read there that ONLY groups, projects names and their hierarchies can be visible from another ip addresses than restricted:

Users can still see group and project names and hierarchies. Only the following are restricted:  
Groups, including all group resources.  
Project, including all project resources.   

As I understand the documentation all project resources should be restricted.

I found a scenario where we set the "Restrict access by IP address" to specified ip address then group member from another ip address can view snippets names of the projects of the PoC group - Bypassing "Restrict access by IP address" to view snippets names of the restricted group projects.

2. Scenario:

2.1. Actors:
User A - private group A owner with Gitlab public profile
User B - private group A member e.g. role Guest

2.2. Steps:

  1. User A - create the private project AP in PoC group A
  2. User A - create a private snippet APS_1 in the PoC project AP
  3. User A - in the PoC group A go to Settings -> General -> Permissions and group features and set Restrict access by IP address to specified ip address
  4. User B - try to access to the PoC group A from another ip address than specified - you should see 404 not found - expected behaviour
  5. User B - go to User A public Gitlab profile then open tab Snippets - notice that you see there the snippet APS_1 - Bypassing "Restrict access by IP address" to view snippets names of the restricted group projects
  6. User A - now, in the project AP create the new private snippet APS_2
  7. User B - refresh the tab Snippets of the public profile of User A - notice that you also see the snippet APS_2 there - Bypassing "Restrict access by IP address" to view snippets names of the restricted group projects

Best regards,
Mateusz

Impact

  • Bypassing "Restrict access by IP address" to view snippets names of the restricted group projects

How To Reproduce

Please add reproducibility information to this section:

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 public profile snippets listing does not enforce the group's IP restriction when showing snippet names.

What the attacker needed

A GitLab account; membership in the restricted group; access from a non-allowed IP address; owner has a public profile

How it was found

  1. Create a private project in the group.
  2. Create a private snippet in that project.
  3. Set the group's 'Restrict access by IP address' to a specific address.
  4. As a group member from another IP, confirm the group returns 404.
  5. Visit the owner's public profile snippets tab and see the snippet name.
  6. Create another private snippet and refresh the profile tab to see its name too.

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.

A group can be set to only allow access from certain IP addresses, so people elsewhere should not see its projects or their contents. Here, a member outside the allowed address could still see the names of private snippets by looking at the owner's public profile page, which should have been blocked.

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.