[GITLAB] — Just another SSRF issue.
The GitLab Kubernetes cluster integration allowed an attacker to supply an arbitrary API URL, which the server then requested. This let an authenticated user probe internal network services, as shown by retrieving an SSH banner from localhost.
Published on ltsirkov.medium.com
Today I am going to talk about the second SSRF vulnerability that I have identified in Gitlab. Just to emphasize again that I’ve never considered seriously participating in bug bounty programs as a full-time job so I discovered all vulnerabilities by chance.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the application did not validate or restrict the API URL field before making a server-side request to it.
Impact
An attacker could perform port scanning against the internal network or services, as confirmed by the SSH banner returned from localhost.
What the attacker needed
A GitLab account; ability to create a project
How it was found
- Create a project.
- Open the project and go to Operations -> Kubernetes.
- Open Add Kubernetes cluster.
- Go to the Add existing cluster page.
- Fill in the API URL field with a local address and port.
- Press Add Kubernetes Cluster and open the Monitoring page to see the output.
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 write-up has not been written yet. The Original tab links to the source.
Server-side request forgery (SSRF) is when a website fetches a URL on your behalf, but you can point it at internal systems you shouldn't reach. Here, the Kubernetes cluster setup page let the user type any address, and the server tried to connect to it. The attacker could then use error messages to learn what services are running inside the network.
What is SSRF?
The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.