Skip to content
Access control Disclosed report Beginner

Project statistics attribute is accessible by Reporter project members via GraphQL API

GitLab

Originally disclosed on GitLab

  • Fixed in 4 months
  • Disclosed after 4 months

Update

After discussing, this is no longer a security issue. Changes were made so docs and both statistics permissions are consistent.

HackerOne report #1109795 by jimeno on 2021-02-23, assigned to GitLab Team:

Report | Attachments | How To Reproduce

Report

Summary

GraphQL Project statistics attribute is accessible by Reporter project members while the official documentation specifies "View project statistics" is only accessible for Developer and above members.

gitlab_project_statistics_permissions.png
gitlab_project_statistics_permissions.png From the original on GitLab
Steps to reproduce
  1. With userA (victim) create a new Public project.

  2. Add a Wiki page, some random commits and a snippet to it so statistics aren't returned as 0.

  3. Go to Members and invite your userB (attacker) user as Reporter max role.

    gitlab_project_members.png
    gitlab_project_members.png From the original on GitLab
  4. With your attacker user, browse to the GitLab GraphQL explorer endpoint.

  5. Run the following query replacing the project's path with yours:

    GraphQL
    query h1test {  
      project(fullPath: "naaytesting2/foobarbazz") {  
        id  
        statistics {  
          snippetsSize  
          wikiSize  
          commitCount  
          lfsObjectsSize  
        }  
      }  
    }  
    
  6. Notice project statistics are returned to the Reporter member.

    JSON
    {  
      "data": {  
        "project": {  
          "id": "gid://gitlab/Project/24629076",  
          "statistics": {  
            "snippetsSize": 136314,  
            "wikiSize": 199229,  
            "commitCount": 1,  
            "lfsObjectsSize": 0  
          }  
        }  
      }  
    }  
    
Impact

Unprivileged user is able to access project statistics.

Examples

Attached project export. 2021-02-23_19-11-551_naaytesting2_foobarbazz_export.tar.gz

What is the current bug behavior?

GraphQL API doesn't honor permissions documentation and allows Reporter project members to see project statistics.

What is the expected correct behavior?

GraphQL API honors permissions documentation and requires at least Developer project membership to see project statistics.

Relevant logs and/or screenshots
graphql_all_details.png
graphql_all_details.png From the original on GitLab
Output of checks

This bug happens on GitLab.com

Results of GitLab environment info

N/A

Impact

Unprivileged user is able to access project statistics.

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.

What is known

A medium-severity access control bug in gitlab.com. GitLab made it public on 30 June 2021. Fixed in version 14.1.

About 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.

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.