Skip to content
Access control Disclosed report Intermediate

Users on banned IP addresses can still commit to projects

A group owner can restrict access by IP address, but a user on a blocked IP can still commit to projects via the GraphQL API. An attacker on a banned IP could push changes to a project that should be completely blocked.

GitLab

Originally disclosed on GitLab

  • Fixed in 38 days
  • Disclosed after 38 days

⚠️ 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 #1914049 by js_noob on 2023-03-21, assigned to GitLab Team:

Report | Attachments | How To Reproduce

Report

Summary

Hello team, as a part of the grp/project security an owner can block certain IP addresses from accessing that group resources (projects,...). However, even if a user is on a blocked IP address he can still commit to projects.

Steps to reproduce
  1. Create a grp, project and add a maintainer
  2. From the owner navigate to https://gitlab.com/groups/YOUR_GRP/-/edit#js-permissions-settings and add the maintainer IP address under Restrict access by IP address
  3. From the maintainer navigate to https://gitlab.com/GRP/PROJECT/-/tree/main and verify the 404
  4. From the maintainer send the following request, but change the variables according to your preferences
POST /api/graphql HTTP/2  
Host: gitlab.com  
Cookie: YOUR_COOKIES  
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/111.0  
Accept: */*  
Accept-Language: en-US,en;q=0.5  
Accept-Encoding: gzip, deflate  
Referer: https://gitlab.com/-/graphql-explorer?_gl=1*1mb1g5a*_ga*MjM3Mzk5MDUzLjE2NzczMjcxMTY.*_ga_ENFH3X7M5Y*MTY3ODk4Mzg2Ni40LjEuMTY3ODk4MzkwNi4wLjAuMA..  
Content-Type: application/json  
X-Csrf-Token: xD3r11jgwirOfA6E1GB1pL9ZEuq8lqQCYcrZo4eSO8xbfvb9kmkI5BmsLqWWtgLw894u3hwjqXeGO4LbPJ_cNg  
Content-Length: 489  
Origin: https://gitlab.com  
Sec-Fetch-Dest: empty  
Sec-Fetch-Mode: cors  
Sec-Fetch-Site: same-origin  
Te: trailers

{"query":"mutation MyMutation {\n  commitCreate(\n    input: {\n      projectPath: \"test645811/project-1\",\n      branch: \"main\",\n      message: \"This is a Commit\",\n      actions: [\n        {\n          action: UPDATE,\n          filePath: \"README.md\",\n          content: \"This is a test content\",\n          encoding: TEXT\n        }\n      ]\n    }\n  ) {\n    commit {\n      author {\n        name\n      }\n    }\n  }\n}\n","variables":null,"operationName":"MyMutation"}  
  1. Verify the successful response and from the owner verify the creation of the commit
Video/POC
bandicam_2023-03-21_20-40-59-702.mp4 From the original on GitLab

Impact

Users from banned IP addresses can manage push changes to project where they should be completely blocked from accessing any project that belongs to that group.

Attachments

Warning: Attachments received through HackerOne, please exercise caution!

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

Impact

Users from banned IP addresses can still push changes to projects where they should be completely blocked from accessing any project that belongs to that group.

What the attacker needed

A GitLab account; membership in a group with IP restriction; access to a blocked IP address

How it was found

  1. Create a group, project, and add a maintainer.
  2. As owner, add the maintainer's IP address under 'Restrict access by IP address'.
  3. As maintainer, navigate to the project tree and verify a 404.
  4. As maintainer, send a GraphQL mutation to create a commit.
  5. Verify the commit was created.

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 owner can block IP addresses from accessing group resources, but a user on a blocked IP can still commit to projects via the GraphQL API.

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.