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.
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.
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
- Set up a custom DNS server controlling a hostname.
- Create a webhook with that hostname; the initial lookup may error, which is expected.
- Use CNAME records to defeat caching and wait 10-15 seconds between attempts.
- Trigger a test delivery of a push event.
- 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.