Skip to content
Info disclosure Disclosed report Beginner

Anonymous Access to Private Artifacts via Job Logs

Private job artifacts marked as non-public could still be accessed by anonymous users through the job log file, which contained the artifact's contents. An attacker could download the job log to read sensitive data that was meant to be private.

GitLab

Originally disclosed on GitLab

  • Fixed in 25 hours
  • Disclosed after 25 hours

⚠️ Please read the process on how to fix security issues before starting to work on the issue. Vulnerabilities must be fixed in a security mirror.

HackerOne report #2649468 by hckgirl on 2024-08-10, assigned to @kmorrison1:

Report | Attachments | How To Reproduce

Report

NOTE! Thanks for submitting a report! Please note that initial triage is handled by HackerOne staff. They are identified with a HackerOne triage badge and will escalate to the GitLab team any. Please replace all the (parenthesized) sections below with the pertinent details. Remember, the more detail you provide, the easier it is for us to triage and respond quickly, so be sure to take your time filling out the report!

Summary

Anonymous Access to Private Artifacts via Job Logs

Hello team,

a user in a project can set the artifacts of a job to be private so they're not accessible by any unauthorized user, from the docs:

To deny read access to artifacts in public pipelines for anonymous, guest, and reporter users, set artifacts:public to false

This is working as expected in the UI and the API, however, anonymous unauthorized users can still access those private artifacts using downlowing job.log file

this issue similiar to this fixed issue -
https://gitlab.com/gitlab-org/gitlab/-/issues/456989

but here -

Anonymous and unauthorized users can access private artifacts by downloading job log files. This bypasses the platform's security controls and exposes sensitive data to unauthorized parties.

The ability to download job log files without proper authentication or authorization poses a significant risk to data confidentiality and integrity. Malicious actors can exploit this vulnerability to steal intellectual property, sensitive business information, or other confidential data.

This issue highlights a critical flaw in the platform's security architecture and emphasizes the urgent need for a comprehensive security audit and remediation plan.

Key vulnerabilities:

Bypass of authentication and authorization controls for job log files.
Unauthorized access to private artifacts.
Potential for data exfiltration and intellectual property theft.

steps of reproduce this issu

1.Login on gitlab.com as the victim
Navigate to the Groups section, click on the New Group button and successfully create a new group

2.Browse to the created group > Settings> Billingand apply theGitLab Ultimate trial`

3.Go to the created group and click on the New Project button, then successfully create a new Public project

4.Create a .gitlab-ci.yml file in the project created - a private ENV artifact will be created:

´´´
build_vars:
stage: build
script:
- echo "BUILD_VERSION=secret_44847557557" >> build.env
artifacts:
reports:
dotenv: build.env
public: false

´´´

5.A job will be created by the file - check in the Build > Pipelines section once the job has finished

6.Browse to the Build > Artifacts in the project to look at the created artifact

7.AS owner download .env.gz (dotenv) private file

see there content of this private file

‹ýO·f ÿbuild.env build.env  ! ÞÿBUILD_VERSION=secret_44847557557  
   ÿÿ ´h¸#!  

8.Open an anonymous tab and log in as the attacker on gitlab.com

9.Navigate to the project's artifacts page and confirm the inability to download the private .env artifact

IMG-20240810-WA0003.jpg
IMG-20240810-WA0003.jpg From the original on GitLab

10.now click to download job.log file

Observe this file , which contains the value of the BUILD_VERSION variable from the private artifact:

IMG-20240810-WA0001.jpg
IMG-20240810-WA0001.jpg From the original on GitLab

Here clean Video poc -please watch it,,,,

bandicam_2024-08-10_16-59-38-329.mp4 From the original on GitLab

Impact

Impact -

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.

How it worked

Root cause

Likely the job log includes the output of commands that write secrets to artifact files, and the log is accessible to anonymous users even when the artifact is marked private.

What the attacker needed

A GitLab Ultimate trial; a public project; CI job that writes secret to artifact; artifact set to private

How it was found

  1. Create a group and start an Ultimate trial.
  2. Create a public project in the group.
  3. Add a CI configuration that writes a secret to a dotenv artifact and sets the artifact to private.
  4. Run the pipeline and confirm the artifact is created.
  5. As the owner, download the private artifact and see the secret.
  6. As an anonymous user, download the job log and see the same secret.

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, you can mark a job's output files (artifacts) as private so only certain people can see them. However, the log of that job still showed the secret value that was written into the artifact. So anyone who could see the job log could learn the secret, even if they couldn't download the artifact directly.

What is Info disclosure?

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.

More from GitLab

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.