Skip to content
SSRF Disclosed report Beginner

SSRF via git Repo by URL Abuse

The GitLab feature that imports a repository from a URL did not validate the supplied URL, so an attacker could make GitLab's server send requests to any address. This could be used to probe internal networks or external hosts from GitLab's infrastructure.

oroborus Follow

Originally disclosed on HackerOne

Medium 6.6 View original
  • Disclosed after 11 months

Hi team ,

First things first, awesome work with <3 Gitlab

######Description : When creating a repository there is an option to pull existing repo from github by providing your github repos url endpoint, then a request is made to that url endpoint to fetch data and create repo on github fair enough till here. But the issue i wanna address here is that you are not validating that the URL provided by user this lets any malicious user request any arbitrary url on the internet and use gitlabs server to connect back to him.

######Steps to Reproduce :

  1. Create a repo
  2. Click on git repo by url option
  3. Enter url of your public server and create a repo
  4. Now if you access your servers access logs you will find
HTTP
 40.84.0.225 - - [14/Dec/2016 11:36:33] "GET /info/refs?service=git-upload-pack HTTP/1.1" 404 - 

Which is requested by gitlab when creating the repo.

######POC:

As a poc i simply port forwarded port 4444 on my router and started simple HTTP server and listened on 4444 to check for incoming connections, by doing the steps mentioned above i got a GET request from 40.84.0.225 , images for the same are attached for reference.

######Impact:

Successful attack on this issue can lead to the following:

  • Port scan intranet and external Internet facing servers
  • Fingerprint internal (non-Internet exposed) network aware services
  • Perform banner grabbing
  • Run code on reachable machines
  • Enumerate and attack services that are running on these hosts

Although i have not tested for any of these yet, this issue can still be misused to use this endpoint to initiate port scans or dos on other servers on the internet, as the hits will be going from your endpoint.

Cheers! ####Siddhu

Attachments

1.PNG
1.PNG From the original on HackerOne
2.PNG
2.PNG

The original report as published on HackerOne, by oroborus. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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 repository import feature passed the user-supplied URL directly to the server-side fetch without validating or restricting the destination.

Impact

An attacker could use GitLab's server to reach internal or external hosts, potentially enabling port scanning, service fingerprinting, banner grabbing, code execution on reachable machines, and attacks on those services, though the reporter had not tested these.

What the attacker needed

A GitLab account able to create repositories; a server the attacker controls to receive requests

How it was found

  1. Create a repository.
  2. Choose the option to import a repository by URL.
  3. Enter the URL of a public server you control and create the repository.
  4. Check your server's access logs for a request coming from GitLab.

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 ask GitLab to copy a repository from a web address, GitLab's server fetches that address for you. The report says GitLab did not check which address you gave it, so someone could give an address inside GitLab's own network and use GitLab as a middleman to reach places they normally could not. This kind of flaw 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.

More by oroborus

View all

2 more disclosed reports, best first.

More from GitLab

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Server-side request forgery (SSRF)

The lesson behind this report.

The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.