Skip to content
Access control Disclosed report Beginner

Productivity analytics endpoint doesn't enforce properly tier check

The productivity analytics endpoint only checked the premium licence when a group or project identifier was supplied, so omitting both parameters let any authenticated user retrieve the analytics data. An attacker could therefore use a paid feature without paying, though only data they could already see was returned.

GitLab

Originally disclosed on GitLab

  • Fixed in 6 days
  • Disclosed after 6 days

HackerOne report #707375 by rpadovani on 2019-10-03, assigned to @cmaxim:

Summary

The new Productivity Analytics feature should be available only to Premium or higher accounts.

The endpoint to retrieve data for the feature, however, doesn't properly authenticate the user, allowing any user to retrieve the data, making the feature easily available to anyone.

However, there isn't any leak of confidential data, because the users retrieve only data that they could already retrieve, if they had paid.

It is just an unauthorized access to paid resources.

Steps to reproduce

  1. The endpoint /-/analytics/productivity_analytics, when queried for a JSON reply using the Accept header, returns data in the JSON format. If you do not specify anything, it returns the HTML page.
  2. The endpoint authenticates the parameter group_id and project_id. That is, it checks the group or the project has at least a premium license.
  3. If you do not specify nor the group_id or the project_id, the endpoint just executes the query.
  4. In this way, you can access all the data needed to do the analytics. You can also access public data of other projects that are not usually easily accessible.
  5. Since a lot of parameters are accepted, it is easy to customize the search to return only the MR of a project that is not under the premium license. E.g: using the my_reaction_emoji parameter.

Here the list of accepted parameters:

  • scope: 'created_by_me' or 'assigned_to_me' or 'all'  
    
  • state: 'open', 'closed', 'merged', 'locked', or 'all'  
    
  • milestone_title: string  
    
  • author_id: integer  
    
  • assignee_id: integer  
    
  • search: string  
    
  • in: 'title', 'description', or a string joining them with comma  
    
  • label_name: string  
    
  • sort: string  
    
  • non_archived: boolean  
    
  • my_reaction_emoji: string  
    
  • source_branch: string  
    
  • target_branch: string  
    
  • created_after: datetime  
    
  • created_before: datetime  
    
  • updated_after: datetime  
    
  • updated_before: datetime
    

Impact

Users can access a premium feature for free without any difficulty (a proxy or a browser plugin would work well enough)

Examples

This is an example of a fetch request made from the console, so with the cookies:

 a = await fetch("https://gitlab.com/-/analytics/productivity_analytics?scope=created_by_me", {  
    "credentials": "include",  
    "headers": {  
        "Accept": "application/json, text/plain, */*",  
        "X-CSRF-Token": "token",  
        "X-Requested-With": "XMLHttpRequest"  
    },  
    "referrer": "https://gitlab.com/-/analytics/productivity_analytics",  
    "method": "GET",  
    "mode": "cors"  
});  
await a.json()  

The response is an array of 20 objects with all the data needed by the feature

What is the current bug behavior?

I can query the productivity_analytics endpoint without specifying group_id nor project_id

What is the expected correct behavior?

group_id or project_id are required, and they are used to check I am allowed to access the resource

Output of checks

This bug happens on GitLab.com

Impact

Users can access a premium feature for free without any difficulty (a proxy or a browser plugin would work well enough)

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 authorisation check was tied to the optional group_id and project_id parameters, so a request without either parameter bypassed the licence validation.

Impact

Users could access a premium feature for free, but no confidential data was leaked because only data they could already retrieve was returned.

What the attacker needed

A GitLab account; ability to send HTTP requests

The fix

The endpoint should require a group_id or project_id and use it to verify the caller's licence before running the query.

How it was found

  1. Send a request to the productivity analytics endpoint asking for a JSON reply.
  2. Leave out both the group_id and project_id parameters.
  3. Observe that the endpoint returns the analytics data without any licence check.
  4. Optionally add filters such as the reaction emoji parameter to narrow the results.

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.

Some features are meant only for paying customers. The server is supposed to check your account before handing over the data. Here it only checked when you named a group or project, so leaving those out skipped the check entirely.

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.