Manual job variables can be leaked on any instance without auth
The GitLab GraphQL endpoint exposes manual CI/CD variables associated with manual deployments to unauthorised users, including unauthenticated users in public projects. An attacker could retrieve sensitive deployment secrets that should be restricted to maintainers or owners.
GitLab
Originally disclosed on GitLab
- Fixed in 6 months
- Disclosed after 6 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 #3026559 by pwnie on 2025-03-08, assigned to @ngeorge1:
Report | How To Reproduce
Report
Summary:
The GitLab GraphQL endpoint exposes manual CI/CD variables associated with manual deployments to unauthorized users—even unauthenticated users in public projects. This lack of independent authorization allows an attacker to retrieve sensitive deployment secrets that should be restricted to maintainers or owners.
Steps to Reproduce:
- Set Up a Public Project and Manual Deployment Job:
- Create a new public project on gitlab.com.
- Add a deployment job with a manual trigger in your
.gitlab-ci.yml:YAML stages: - deploy deploy-manual: stage: deploy when: manual script: - echo "Deploying with manual variables" environment: name: staging
- Configure Manual Variables:
- In the GitLab UI, configure one or more manual CI/CD variables for the job. These variables may contain sensitive information intended for secure, on-demand use.
- Access the Vulnerable Endpoint:
- Open the GitLab GraphQL Explorer (or any GraphQL client) without logging in (or with a guest-level account).
- Execute the GraphQL Query:
- Run the following query, replacing
"your/full/project/path"with your actual project path:GraphQL query getJobManualVariables() { project(fullPath: "your/full/project/path") { pipelines { nodes { jobs { nodes { manualVariables { nodes { key value environmentScope } } } } } } } }
- Run the following query, replacing
- Observe the Issue:
- The query response reveals the manual variables, including keys, values, and their environment scopes, even though this data should be restricted.
Impact:
An attacker (or any unauthenticated/guest user) can retrieve sensitive manual variables from public projects via the GraphQL API. This could lead to exposure of deployment secrets and other sensitive information, compromising the security of CI/CD processes.
Recommendation:
Implement independent, field-level authorization checks for the manualVariables field within the GraphQL API. Ensure that sensitive manual variables are only accessible to users with the necessary privileges (e.g., project maintainers or owners). Additionally, consider masking or restricting the display of sensitive values to prevent accidental disclosure.
By tightening access control on this GraphQL field, GitLab can better protect confidential deployment data and reduce the risk of unauthorized secret disclosure.
Impact
An attacker (or any unauthenticated/guest user) can retrieve sensitive manual variables from public projects via the GraphQL API. This could lead to exposure of deployment secrets and other sensitive information, compromising the security of CI/CD processes.
Impact
An attacker (or any unauthenticated/guest user) can retrieve sensitive manual variables from public projects via the GraphQL API. This could lead to exposure of deployment secrets and other sensitive information, compromising the security of CI/CD processes.
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 missing field-level authorisation checks on the manualVariables field in the GraphQL API, allowing any user to query it without verifying permissions.
Impact
An attacker (or any unauthenticated/guest user) can retrieve sensitive manual variables from public projects via the GraphQL API, potentially exposing deployment secrets and compromising CI/CD security.
What the attacker needed
Public project; manual deployment job; manual CI/CD variables configured; no authentication needed
How it was found
- Create a new public project on gitlab.com.
- Add a deployment job with a manual trigger in the .gitlab-ci.yml file.
- Configure one or more manual CI/CD variables for the job in the GitLab UI.
- Open the GitLab GraphQL Explorer or any GraphQL client without logging in (or with a guest-level account).
- Execute a GraphQL query that requests manualVariables for jobs in the project's pipelines.
- Observe that the query response reveals the manual variables, including keys, values, and environment scopes.
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, CI/CD variables are like secret settings used when deploying software. The GraphQL API, which lets programs ask for data, was giving out these secrets to anyone, even people not logged in, if the project was public. This means someone could see passwords or keys meant only for trusted maintainers.
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.