SSRF vulnerability in gitlab.com webhook
GitLab's webhook integration feature allowed a user to supply a URL pointing at localhost, and the server fetched it, returning the response. An attacker could use this to probe internal services and ports on the GitLab server's network.
- Triaged in 19 hours
- Fixed in 3 months
- Disclosed after 4 months
1、 Login to your GitLab account and create a new project, then go to-->>https://gitlab.com/{username}/{project}}/settings/integrations
2、 You can add url to ssrf.following are the steps to reproduce:
If you enter http://127.0.0.1:80/haha.txt as url,we will get -->>Hook executed successfully but returned HTTP 404 <html> <head><title>404 Not Found</title></head> <body bgcolor="white"> <center><h1>404 Not Found</h1></center> <hr><center>nginx/1.12.1</center> </body> </html>
If you enter http://127.0.0.1:9200/haha.txt as url, we will get -->>Hook execution failed: Failed to open TCP connection to 127.0.0.1:9200 (Connection refused - connect(2) for "127.0.0.1" port 9200) (indicating that the port is actually closed.)
The test was done on https://gitlab.com/
I did not do more test.Thanks
Impact
can scan the intranet to get sensitive information.
Attachments


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 webhook URL was not validated against private or loopback address ranges before the server made the request.
Impact
An attacker could scan the internal network for sensitive information.
What the attacker needed
A GitLab account; ability to create a project; ability to configure integrations
How it was found
- Log in to GitLab and create a new project.
- Open the project's integrations settings page.
- Add a webhook URL pointing at the loopback address on port 80.
- Enter the loopback URL on port 80 and observe the returned 404 page from the local nginx server.
- Enter the loopback URL on port 9200 and observe a connection refused error, showing the port is closed.
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.
A webhook is a URL that a website calls automatically when something happens. Here, GitLab let a user set that URL to the server's own loopback address, so GitLab itself made requests to internal services. This is called server-side request forgery (SSRF): the server is tricked into fetching addresses the user cannot reach directly.
What is SSRF?
The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.