SSRF in GitLab Self-Hosted — Import From URL
The 'Import Project from URL' feature in GitLab self-hosted accepted user-supplied URLs and made server-side requests without blocking internal addresses. An authenticated attacker could force the server to request arbitrary URLs and use response timing differences to probe internal ports.
Published on ikramiwalid.medium.com
I discovered a Server-Side Request Forgery (SSRF) vulnerability in the “Import Project from URL” feature of a GitLab self-hosted instance. The vulnerability allows an authenticated user to force the GitLab server to issue HTTP requests to arbitrary URLs.
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 import feature accepted user-supplied URLs without an allowlist, without blocking private IP ranges, and without egress filtering.
Impact
An authenticated user could make the GitLab server request arbitrary URLs and use timing differences to map internal services, potentially discovering admin panels, databases, or cloud metadata endpoints.
What the attacker needed
Authenticated GitLab user; self-hosted GitLab instance; attacker-controlled callback server
The fix
The report recommends an allowlist, blocking private IP ranges, an egress proxy, timeouts, and firewall rules; it does not state that a fix was applied.
How it was found
- Set up a callback server that logs incoming requests.
- In GitLab, go to Import Project and choose From URL.
- Enter the callback server address as the Git repository URL.
- Check the callback logs for a request from the GitLab server.
- Intercept the import request and send it to an intruder tool.
- Iterate over port numbers in the URL and compare response lengths or status codes to find open ports.
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 is tricked into fetching a URL chosen by an attacker, so the request comes from the server itself. Here, the import feature fetched any URL, letting an attacker make the server talk to internal machines. By watching how long the server took to respond, the attacker could guess which internal ports were open.
What is SSRF?
The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.