Deployment Job Traces and Manual Variables Accessible via GraphQL by anyone
The GitLab GraphQL endpoint for deployment jobs lacked independent authorization, relying only on parent type checks. A guest-level user on a public project could retrieve job traces and manual CI/CD variables that should have been confidential.
GitLab
Originally disclosed on GitLab
- Fixed in 5 months
- Disclosed after 5 months
⚠️ 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 #2969145 by pwnie on 2025-02-01, assigned to @cmaxim:
Report | How To Reproduce
Report
Summary:
The GitLab GraphQL endpoint for deployment jobs lacks independent authorization. Instead, it relies on its parent type’s authorization with field-level checks. This design flaw allows any user with at least guest access to a public project to retrieve sensitive information—namely, job traces and manual CI/CD variables—even when these details should remain confidential.
Steps to Reproduce:
-
Set Up an Environment and Deployment Job:
-
Navigate to gitlab.com and create an environment for your project (choose any name).
-
Create a deployment job for this environment. For example, if the environment is named
foobar, use the following.gitlab-ci.ymlconfiguration:YAML stages: - deploy deploy-to-foobar: stage: deploy script: - echo "Hello World" > index.html - echo "Deploying to foobar environment" environment: name: foobar url: http://foobar.example.com
-
-
Trigger the Deployment:
- Let the deployment job finish.
- Update the CI/CD variables:
- Go to Build → Jobs.
- Click on the deployment job.
- Click the circular arrows (update CI/CD variables) in the upper-right.
- Enter any value in the variables form, trigger the new job, and allow it to finish.
-
Adjust Project Privacy Settings:
- In your project settings, navigate to CI/CD → General Pipelines.
- Disable the Public pipelines option and save the changes.
-
Access the Vulnerable Endpoint with a Guest Account:
- Create a second GitLab account and add it to your project with Guest permissions.
- Log in with the second account and open the GitLab GraphQL Explorer.
-
Execute the GraphQL Query:
-
Input the following query into the explorer:
GraphQL query getEnvironmentJobDetails( $projectFullPath: ID! $environmentName: String! ) { project(fullPath: $projectFullPath) { environment(name: $environmentName) { lastDeployment(status: SUCCESS) { job { trace { htmlSummary } manualVariables { nodes { environmentScope } } } } } } } -
In the variables section, enter:
JSON {"projectFullPath": "your/full/project/path", "environmentName": "foobar"}Replace
"your/full/project/path"and"foobar"with your actual project path and environment name. -
Run the query.
-
-
Observe the Issue:
- The query response will include the job trace (
htmlSummary) and manual variables, exposing details that should be confidential.
- The query response will include the job trace (
Impact:
An attacker with guest-level access to a public project can exploit this vulnerability to read sensitive deployment job traces and manual CI/CD variables. This exposure could lead to unauthorized access to confidential information, including external secrets or data inadvertently included in job outputs.
Components Affected:
- GitLab GraphQL API for deployment jobs.
- Job trace and manual variable data exposed via the
JobTypeentity.
Recommendation:
Implement independent authorization checks within the JobType GraphQL entity rather than solely relying on parent type checks. Enforce robust, defense-in-depth security measures to ensure that sensitive deployment details remain inaccessible to unauthorized users, regardless of project privacy settings.
Impact
An attacker with guest-level access to a public project can exploit this vulnerability to read sensitive deployment job traces and manual CI/CD variables. This exposure could lead to unauthorized access to confidential information, including external secrets or data inadvertently included in job outputs.
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 GraphQL JobType entity did not perform its own authorization check and trusted the parent environment/deployment check, which allowed guests to access fields like trace and manualVariables.
Impact
A guest-level user on a public project could read sensitive deployment job traces and manual CI/CD variables, potentially exposing external secrets or confidential data in job outputs.
What the attacker needed
Public project; guest-level account; deployment job exists; public pipelines disabled
How it was found
- Create an environment and a deployment job for a project.
- Run the deployment job and update CI/CD variables via the job page, then let the new job finish.
- Disable the Public pipelines option in project CI/CD settings.
- Add a second account as Guest to the project and log in.
- Open the GraphQL Explorer and run a query for the environment's last successful deployment job, requesting trace.htmlSummary and manualVariables.
- Observe that the response includes the job trace and manual variables.
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, a project can be public, and even a guest (someone with minimal access) can see some parts. The GraphQL API is a way to ask for data. The bug meant that a guest could ask for sensitive deployment job logs and variables that were supposed to be hidden when public pipelines were turned off.
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.