Skip to content
Access control Disclosed report Beginner

Lack of authorization for integrated error tracking

The integrated error tracking endpoints in GitLab did not require authentication, allowing anyone to read, update, or delete error data for any project. An attacker could bypass role-based access controls and access sensitive error information.

GitLab

Originally disclosed on GitLab

  • Fixed in 18 days
  • Disclosed after 18 days

HackerOne report #1748522 by 0xn3va on 2022-10-24, assigned to GitLab Team:

Report | How To Reproduce

Report

Summary

In the latest release Gitlab provided integrated error tracking that implements a lightweight alternative to Sentry backend. It allows developers to use Gitlab backend as a collector for errors. You can find the docs here. In gitlab.com DSN URL looks like:

https://glet_<token>[@]observe.gitlab.com:443/errortracking/api/v1/projects/<project_id>  

So, you can use this URL for working with a Sentry-like API that allows you to perform at least the following actions:

  • GET /projects/{projectId}/errors/{fingerprint} Get information about the error
  • GET /projects/{projectId}/errors List of errors
  • GET /projects/{projectId}/errors/{fingerprint}/events Get information about the events related to the error
  • PUT /projects/{projectId}/errors/{fingerprint} Update the status of the error
  • GET /projects/{projectId}/errors/{fingerprint}/events Get information about the events related to the error
  • POST /projects/api/{projectId}/envelope Ingestion endpoint for error events sent from client SDKs
  • POST /projects/api/{projectId}/store Ingestion endpoint for error events sent from client SDKs
  • DELETE /projects/{id} Deletes all project related data. Mostly for testing purposes and later for production to clean updeleted projects.

The problem is that these endpoints do not require authentication. As a result, it is possible to gain unauthorized access to the errors and even update/delete them.

Steps to reproduce
  1. Clone the following files on your laptop https://gitlab.com/gitlab-org/opstrace/opstrace/-/tree/main/docs/guides/user/error_tracking_examples/python

  2. Create a virtualenv:

    Bash
    virtualenv -p python3 venv  
    source venv/bin/activate  
    
  3. Install dependencies:

    Bash
    pip install -r requirements.txt  
    
  4. Create a private repo

  5. Go to Settings > Monitor > Error tracking

  6. Enable error tracking and set Gitlab as error tracking backend

  7. Save changes and reload the page

  8. Catch the DSN token

  9. Export the DSN token to environment variables:

    Bash
    export SENTRY_DSN="https://glet_<token>[@]observe.gitlab.com:443/errortracking/api/v1/projects/<project_id>"  
    
  10. Run the python script:

    Bash
    python send_exception.py  
    
  11. The script uploads an error to the backend; you can find this error on the Monitor > Error Tracking page

  12. Send the following request to retrieve errors for the your project:

    Bash
    curl  "https://observe.gitlab.com:443/errortracking/api/v1/projects/<PROJECT_ID>/errors"  
    
  13. Send the following request to delete all errors in the your project:

    Bash
    curl -XDELETE  "https://observe.gitlab.com:443/errortracking/api/v1/projects/<PROJECT_ID>"  
    
Impact

According to the docs user must have at least Reporter role to access errors and Maintainer to manage them. This vulnerability allows an attacker to bypass these restrictions and gain unauthorized access to errors.

What is the current bug behavior?

Integrated error tracking does not implement authorization for accessing and managing errors.

What is the expected correct behavior?

Integrated error tracking requires a token for making requests and provides access to errors according to the permission policy.

Output of checks

This bug happens on GitLab.com

Impact

According to the docs user must have at least Reporter role to access errors and Maintainer to manage them. This vulnerability allows an attacker to bypass these restrictions and gain unauthorized access to errors.

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

Root cause

The error tracking API endpoints lacked authentication and authorization checks.

Impact

An attacker could bypass role-based access controls to read, update, or delete error data for any project, potentially exposing sensitive information.

What the attacker needed

Knowledge of the project ID; No authentication required

The fix

The endpoints should require authentication and enforce the permission policy.

How it was found

  1. Clone the example error tracking files from GitLab's repository.
  2. Set up a Python virtual environment and install dependencies.
  3. Create a private GitLab repository and enable error tracking with GitLab as the backend.
  4. Capture the DSN token from the error tracking settings.
  5. Run the provided Python script to send an error to the backend.
  6. Send a request to the errors endpoint without authentication to retrieve or delete errors.

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.

Error tracking is a feature that collects and displays errors from applications. In GitLab, this data should only be visible to project members with certain roles. However, the endpoints that handle this data were not protected, so anyone who knew the project ID could access or modify the errors without logging in.

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.