Skip to content
SSRF Disclosed report Intermediate

SSRF vulnerability in gitlab.com via project import.

The project import feature blocked obvious loopback addresses such as [redacted] and localhost, but alternative numeric notations of the same address still reached internal services. An attacker could use these forms to probe internal ports through the import error messages.

edoverflow Follow

Originally disclosed on HackerOne

Medium 5.4 View original
  • Triaged in 2 months
  • Fixed in 8 months
  • Disclosed after 8 months

Dear GitLab bug bounty team,

Summary


It appears as though the fix to !17286 can be easily bypassed. You have blocked the usage of http://127.0.0.1, http://localhost/, etc., but http://0177.1/ and http://0x7f.1/, for instance, can still be used to scan internal ports.

Error importing repository http://0177.1:22/ into {username}/{project} - Cloning into bare repository '[REPOS PATH]/{username}/{project}.git'...
fatal: unable to access 'http://0177.1:22/': Recv failure: Connection reset by peer

Admittedly, you have restricted the use of certain ports, but I still believe this needs to be fixed.

Fix


Block decimal, octal and hex localhost notation.

Best regards, Ed

The original report as published on HackerOne, by edoverflow. 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 blocklist matched only literal hostname strings instead of resolving and validating the actual IP address.

Impact

An attacker could scan internal ports on the GitLab host, though the text notes that some ports were already restricted.

What the attacker needed

Ability to create or import a project

How it was found

  1. Start a project import that accepts a repository URL.
  2. Supply a loopback address written in an alternative numeric notation.
  3. Read the import error output to learn whether the internal port responded.

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 a server fetches a URL for you, it can be tricked into contacting machines on its own private network. The site tried to block this by rejecting the usual names for 'this machine', but the same address can be written in other number formats, so the check was bypassed.

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 edoverflow

View all

27 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.