Skip to content
SSRF Write-up Advanced

The Bouncer Who Waved Everyone In When the Scanner Broke: A $3,500 GitLab SSRF

GitLab's webhook URL validator failed to apply DNS-rebinding protection when DNS resolution failed, allowing an attacker to bypass the check and reach internal addresses. An attacker could make the server send requests to internal services, including cloud metadata endpoints.

T4nv1 Follow

Published on medium.com

Also notable: the third-party write-up describes this as a bypass of an earlier fix. GitLab had already tried to stop DNS rebinding in this file.

T4nv1, on medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the URL validator's error handling failed open: when DNS resolution raised an error, it returned the hostname without pinning an IP, so the HTTP client resolved again and could reach an internal address.

Impact

An attacker could make GitLab send requests to internal services, potentially leading to further compromise depending on the environment.

What the attacker needed

Control a domain and its DNS server; ability to create webhooks in GitLab; timing to bypass DNS caching

The fix

The fix was to fail closed: if the destination cannot be verified, refuse the request instead of proceeding.

How it was found

  1. Set up a custom DNS server controlling a hostname.
  2. Create a webhook with that hostname; the initial lookup may error, which is expected.
  3. Use CNAME records to defeat caching and wait 10-15 seconds between attempts.
  4. Trigger a test delivery of a push event.
  5. Observe responses from internal targets such as cloud metadata and localhost.

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 write-up has not been written yet. The Original tab links to the source.

A webhook lets a user give a URL that the server will call. If the server can be tricked into calling internal addresses, that is called SSRF. GitLab tried to block this by checking the address first, but if the check itself failed, it let the request go through anyway.

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 T4nv1

View all

113 more disclosed reports, best first.

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.