SSRF when importing a project from a git repo by URL
GitLab instances with project imports via 'Repo by URL' were vulnerable to SSRF, allowing an attacker to target services bound to the local interface by specifying a localhost import URL. These services often lack authentication, so the attacker could potentially craft an attack using the import request URL.
- Triaged in 33 hours
- Fixed in 11 months
- Disclosed after 2.1 years
Summary by the program
Fixed in 8.17.4, 8.16.8, and 8.15.8
SSRF when importing a project from a Repo by URL
GitLab instances that have enabled project imports using "Repo by URL" were vulnerable to Server-Side Request Forgery attacks. By specifying a project import URL of localhost an attacker could target services that are bound to the local interface of the server. These services often do not require authentication. Depending on the service an attacker might be able craft an attack using the project import request URL.
This update blocks all import attempts from localhost and all bound server interfaces other than those assigned as GitLab web or SSH services (Typically ports 22 and 443). This update also blocks all import attempts from TCP ports below 1024 with the exception of ports 22, 80 and 443. 17286
Thanks to Strukt via HackerOne for reporting this vulnerability.
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 import feature did not validate or restrict the destination URL, allowing requests to localhost and internal interfaces.
Impact
An attacker could target services bound to the local interface, which often do not require authentication, and might be able to craft an attack using the project import request URL.
What the attacker needed
Project imports via Repo by URL enabled
The fix
The update blocks import attempts from localhost and bound server interfaces other than GitLab web or SSH services, and blocks TCP ports below 1024 except 22, 80 and 443.
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.
Server-Side Request Forgery (SSRF) is when an attacker makes a server send a request to a destination of their choosing. Here, the import feature fetched a URL, and the attacker could point it at the server's own local services, which are often unprotected.
What is SSRF?
The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.