SSRF via workspaces
GitLab's workspace creation process parses a user-supplied .devfile and passes it to an internal Golang binary, which makes HTTP requests to any URI defined in an OpenShift or Kubernetes component. An attacker could make the server send requests to arbitrary internal resources, potentially affecting availability, integrity, and confidentiality.
GitLab
Originally disclosed on GitLab
- Fixed in 4 months
- Disclosed after 4 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 #2734142 by retr02332 on 2024-09-23, assigned to @cmaxim:
Report | Attachments | How To Reproduce
Report
When we create a workspace, Gitlab parses our .devfile, then passes the Devfile to an internal Golang binary to get the necessary data from the Devfile.
In this process, the binary makes an HTTP request to any URI defined in an Openshift or Kubernetes component.
Step by step
- Login to the instance with the user shown below, access the single group and then the project where it gives you access called “traversal-test/kube-project”. Then edit the .devfile.yaml of the project to put the URL of a remote server to receive the request as interact-sh (note that you can also make external requests, as shown in the evidence below).
Gitlab Instance: https://retr02332.site
Username: Hackerone
Password: StrongPassword2332
Impact
A remote attacker can make HTTP requests to arbitrary internal resources, which can result in an attack on availability or in the worst case, integrity and confidentiality.
Attachments
Warning: Attachments received through HackerOne, please exercise caution!
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
Impact
A remote attacker could make HTTP requests to arbitrary internal resources, potentially affecting availability or, in the worst case, integrity and confidentiality.
What the attacker needed
Access to a GitLab project; ability to edit .devfile.yaml; ability to create a workspace
How it was found
- Log in to the GitLab instance and access the project 'traversal-test/kube-project'.
- Edit the project's .devfile.yaml to include a URL pointing to a remote server (e.g., an interactsh URL).
- Create a workspace, which triggers GitLab to parse the .devfile and pass it to the internal binary.
- The binary makes an HTTP request to the specified URL, as shown in the attached video.
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.
When you create a workspace, GitLab reads a configuration file you provide and passes it to a helper program that fetches data from addresses listed in that file. An attacker can make the server contact internal systems. This is called server-side request forgery (SSRF).
What is SSRF?
The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.