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 triagebadge 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

10.now click to download job.log file
Observe this file , which contains the value of the BUILD_VERSION variable from the private artifact:

Here clean Video poc -please watch it,,,,
Impact
Impact -
Attachments
Warning: Attachments received through HackerOne, please exercise caution!
- IMG-20240810-WA0003.jpg
- IMG-20240810-WA0004.jpg
- IMG-20240810-WA0001.jpg
- IMG-20240810-WA0002.jpg
- IMG-20240810-WA0000.jpg
- IMG-20240810-WA0002.jpg
- bandicam_2024-08-10_16-59-38-329.mp4
How To Reproduce
Please add reproducibility information to this section:
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
- Create a group and start an Ultimate trial.
- Create a public project in the group.
- Add a CI configuration that writes a secret to a dotenv artifact and sets the artifact to private.
- Run the pipeline and confirm the artifact is created.
- As the owner, download the private artifact and see the secret.
- 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.