Bypassing SSRF Protections: A $10,000 Lesson from Slack
Slack's SSRF protection validated a URL's resolved IP at one moment but fetched the resource by domain name later, allowing a DNS rebinding attack to redirect the request to an internal IP. An attacker could potentially access internal services, scan the internal network, and reach cloud metadata endpoints.
infosecwriteups.com
Published on infosecwriteups.com
Server-Side Request Forgery (SSRF) vulnerabilities remain one of the most critical security issues in modern web applications. Today, I’m breaking down a fascinating SSRF report that earned a researcher $10,000 from Slack’s bug bounty program, and the valuable lessons we can all learn from it.
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
The SSRF check and the actual fetch were not atomic: the IP was validated once, but the request later re-resolved the domain name, which the attacker could change to an internal address.
Impact
An attacker could potentially access internal services, scan the internal network, bypass localhost authentication, exfiltrate data, and reach cloud metadata endpoints; the text does not state that any of this was actually demonstrated.
What the attacker needed
A feature that fetches user-supplied URLs; attacker controls a DNS server; very low DNS TTL
The fix
The issue was fixed; the proper defence is to resolve the domain once, validate the IP, and then connect to that validated IP directly rather than re-resolving the domain name.
How it was found
- The attacker submits a URL pointing to a domain they control.
- Slack resolves the domain and gets a public IP, so the safety check passes.
- The attacker's DNS server changes the domain to resolve to an internal IP.
- Slack fetches the resource and connects to the internal IP, achieving SSRF.
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.
When a server fetches a link for you, it first checks the address is safe and then connects. If the address can change between the check and the connection, the server can end up connecting somewhere it was told not to, like an internal machine. This trick is called DNS rebinding.
What is SSRF?
The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.