Victim IP disclosure when a victim visits a snippet whose URL has a description containing `////[attacker_site]`
A snippet description containing an image tag with a protocol-relative URL caused the GitLab server to fetch that URL when the snippet was viewed, leaking the viewer's IP address to an external server. An attacker could use this to determine the victim's physical location.
GitLab
Originally disclosed on GitLab
- Fixed in 7 months
- Disclosed after 7 months
HackerOne report #1682809 by ernans on 2022-08-28, assigned to H1 Triage:
Report | Attachments | How To Reproduce
Report
Summary
In this bug SSRF can exposes Victim IP to external server and can make an attacker into determine physical location of Victim.
Step To Reproduce
- Attacker make snippets gitlab and make it public and give descriptions with html code, and bypassed with "////"
Example: {{media:0}} , you can use ngrok+nc listener or any listener domain like postbin
2. Attacker publish the snippet and wait snippet visited by victim
3. When victim visit attacker snippet, server will request into attacker listener domain and forward info like IP and any information
Same as
https://hackerone.com/reports/996273
Suggested
i suggested in program maybe must check in src or href attribute have protocol or not, when a user insert without protocol automatic add https://gitlab.com in front of domain or maybe developer have another technique to prevent this ssrf.
Impact
SSRF Exposes Victims Ip Address to External Server and which made attacker possible to determine physical location of Victim with IP Tracing, and maybe attacker can be exploiting ssrf into scanning ports, etc.
Attachments
Warning: Attachments received through HackerOne, please exercise caution!
How To Reproduce
Please add reproducibility information to this section:
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 application did not validate that URLs in snippet descriptions used an explicit protocol, allowing protocol-relative URLs to trigger server-side requests.
Impact
The attacker could learn the victim's IP address and potentially determine their physical location; the report also suggests possible port scanning, though this is not demonstrated.
What the attacker needed
Attacker can create a public snippet; Victim views the snippet; Attacker controls a listener domain
The fix
The application should validate that URLs in snippet descriptions include an explicit protocol, or otherwise prevent server-side requests to user-supplied URLs.
How it was found
- Create a public GitLab snippet with a description containing an image tag whose source is a protocol-relative URL pointing to an attacker-controlled listener.
- Publish the snippet and wait for a victim to visit it.
- When the victim views the snippet, the GitLab server requests the attacker's listener, which receives the victim's IP address and other information.
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 view a web page, your browser usually loads images directly. Here, the GitLab server itself fetched the image from an attacker-controlled address, so the attacker saw the server's request and learned the viewer's IP address. That IP can reveal roughly where the person is located.
What is SSRF?
The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.