Skip to content
Access control Disclosed report Beginner

Unauthorized User Able to View Approval Settings of Project Through API

An API endpoint for project approval settings lacked proper access control, allowing guest-level users of private projects and anyone for public projects to view the approval rules and approver details. This exposed sensitive information about project approval configurations and the users involved.

GitLab

Originally disclosed on GitLab

  • Fixed in 44 days
  • Disclosed after 44 days

HackerOne report #591233 by rafiem on 2019-05-28, assigned to gitlab_cmaxim:

Hi Team,

I have found improper access control issue in one of gitlab api endpoint. Firstly, to be able to access approvals endpoint of project, using the endpoint : https://gitlab.com/api/v4/projects/<:project_id>/approvals/, the user have to be at least maintainer of the projects. But, using different endpoint : https://gitlab.com/api/v4/projects/<:project_id>/approval_settings/, guest level user of private project is able to view the approval settings endpoint. Additionaly, in the public projects, anyone can view the approval settings endpoint too.

Proof of Concept

1.) User A have 1 public project : https://gitlab.com/fffgggg/bbb and 1 private project : https://gitlab.com/fffgggg/hhhhhhhh
2.) User A then invite User B to the private project of User A (https://gitlab.com/fffgggg/hhhhhhhh) as Guest
3.) Using access token of User B, he/she can view approval settings of both public and private project owned by User A (https://gitlab.com/fffgggg/bbb and https://gitlab.com/fffgggg/hhhhhhhh)
Example url request by User B to the private project of User A

https://gitlab.com/api/v4/projects/12496738/approval_settings/  

Response

JSON
{
    "rules": [  
        {  
            "id": 64142,  
            "name": "sec eng",  
            "rule_type": "regular",  
            "approvers": [  
                {  
                    "id": 3340810,  
                    "name": "bajilak",  
                    "username": "bajilak",  
                    "state": "active",  
                    "avatar_url": "https://secure.gravatar.com/avatar/4df2470fc9a91f7714da157c09bee54b?s=80&d=identicon",  
                    "web_url": "https://gitlab.com/bajilak"  
                },  
                {  
                    "id": 3340785,  
                    "name": "rafie m",  
                    "username": "yeraisci",  
                    "state": "active",  
                    "avatar_url": "https://assets.gitlab-static.net/uploads/-/system/user/avatar/3340785/avatar.png",  
                    "web_url": "https://gitlab.com/yeraisci"  
                },  
                {  
                    "id": 3950756,  
                    "name": "bajigur",  
                    "username": "bajigur",  
                    "state": "active",  
                    "avatar_url": "https://secure.gravatar.com/avatar/6506e9c0a578bf2f4d1687d7fa328b3e?s=80&d=identicon",  
                    "web_url": "https://gitlab.com/bajigur"  
                }  
            ],  
            "approvals_required": 1,  
            "users": [],  
            "groups": [],  
            "contains_hidden_groups": true  
        }  
    ],  
    "fallback_approvals_required": 1  
}

Example url request by User B to the public project of User A

https://gitlab.com/api/v4/projects/12496673/approval_settings/  

Response

JSON
{
    "rules": [  
        {  
            "id": 64141,  
            "name": "QA",  
            "rule_type": "regular",  
            "approvers": [  
                {  
                    "id": 3340810,  
                    "name": "bajilak",  
                    "username": "bajilak",  
                    "state": "active",  
                    "avatar_url": "https://secure.gravatar.com/avatar/4df2470fc9a91f7714da157c09bee54b?s=80&d=identicon",  
                    "web_url": "https://gitlab.com/bajilak"  
                },  
                {  
                    "id": 3340785,  
                    "name": "rafie m",  
                    "username": "yeraisci",  
                    "state": "active",  
                    "avatar_url": "https://assets.gitlab-static.net/uploads/-/system/user/avatar/3340785/avatar.png",  
                    "web_url": "https://gitlab.com/yeraisci"  
                },  
                {  
                    "id": 3950756,  
                    "name": "bajigur",  
                    "username": "bajigur",  
                    "state": "active",  
                    "avatar_url": "https://secure.gravatar.com/avatar/6506e9c0a578bf2f4d1687d7fa328b3e?s=80&d=identicon",  
                    "web_url": "https://gitlab.com/bajigur"  
                }  
            ],  
            "approvals_required": 1,  
            "users": [],  
            "groups": [],  
            "contains_hidden_groups": true  
        }  
    ],  
    "fallback_approvals_required": 1  
}

Impact

Exposing detailed list of approval of projects including the users

Best Regards,
@rafiem

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 approval_settings API endpoint did not enforce the same authorization checks as the approvals endpoint, allowing any user (including guests and anonymous) to read the data.

Impact

A guest of a private project, or anyone for a public project, could view its approval settings, revealing approvers and rules.

What the attacker needed

For private projects: guest access to the project; For public projects: no authentication required

How it was found

  1. User A creates a public project and a private project.
  2. User A invites User B to the private project as a Guest.
  3. User B uses their access token to request the approval_settings endpoint for both projects.
  4. User B receives the approval settings data, including approver details.

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.

In GitLab, projects can have approval rules that require certain people to approve changes. There are two API endpoints: one for managing approvals (which requires maintainer access) and one for viewing approval settings. The viewing endpoint did not check permissions properly, so even low-privileged users (guests) or anonymous users could see the approval rules and the names of approvers. This is an access control flaw.

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.