Blind SSRF to Port Scanning through response time
An image-by-URL feature fetched attacker-supplied URLs on the server without returning the response body, making it a blind SSRF. By timing requests to localhost on different ports, the author could tell open ports (fast replies) from closed ones (delays or timeouts), turning it into a port scanner.
This article is about how I found an Server Side Request forgery in image upload link feature and escalated to port scanning.
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.
Context
This is a write-up about finding a server-side request forgery (SSRF) in an image upload link feature and escalating it into a port scan. The target is described only as a fresh target with a lot of features and functionality, and a few different user roles. The report does not name the product or the program.
The feature in question lets a user upload an image for their organisation, or submit a link to the image instead. The link submission is the interesting part: the server fetches the URL the user supplies.
For readers who have not met the term: blind SSRF vulnerabilities arise when an application can be induced to issue a back-end HTTP request to a supplied URL, but the response from the back-end request is not returned in the application's front-end response.
Setup
The researcher started hunting on a fresh target with several features and user roles. The only tool mentioned is Autorize, configured for IDOR and access control testing, after which normal browsing of the application began. No accounts, versions or other preconditions are described.
Finding it
Cross-site scripting was tested but could not be popped anywhere. The target was in qr, and other testers had messaged that they had tested thoroughly and found nothing. The researcher's point is that the way one person thinks differs from how others do, so something known to everyone can still be missed.
The image upload feature accepted a link to an image. The request was a GET request and the parameter looked like this:
iurl=https://xyz.burpcollab.net/img.jpg
The first attempt used a Burp Collaborator link with /img.jpg appended, to evade validation if any existed. The approach was to first see how the feature is supposed to work, then try to manipulate it. A response came back. On its own this has no impact, because it is a feature and not a bug.
Exploitation
Step 1: point the fetcher at localhost
Reading around for ways to escalate, the researcher tried the localhost address:
url=http://localhost:80
It gave a response. Servers usually block anything related to localhost, and there was no such block here. The response body was not different from before: it simply returned "" in the body of the response.
Step 2: fetch a known remote file
The next attempt was a well-known file on a public host:
url=http://www.google.com/favicon.ico
This returned the base64 of the favicon. At this point not much more was done, because whatever was tried, the response threw an error when any other file type was given.
Step 3: notice the timing difference
Back on localhost testing, the port was changed to 801 and the response was delayed a bit.

To confirm, ports that were known to be open, such as 80 and 443, were tried. They responded almost within 300 millis on average, whereas the invalid ones, 801 and 65000, responded after 1000 millis on average. In other words, the request was delayed and timed out on a closed port and replied instantly on an open port. That timing difference is the oracle: the response body gave nothing useful, but how long it takes to come back did.
Root cause
The application takes a user-supplied URL in the iurl parameter and makes a back-end request to it; requests to localhost were not blocked. Requests to localhost were not blocked, so the server could be pointed at its own loopback interface. Because the response body is not useful (empty for localhost, an error for most file types), the vulnerability is blind, and the only observable signal is response time: a closed port causes the back-end connection attempt to hang until it times out, while an open port answers immediately. The report does not describe the server-side code, so the exact implementation is not known.
Impact
An attacker who can submit an image link can make the server issue requests to localhost and use the response timing to infer which ports are open. In this case the outcome was classified as a port scan, and the researcher received the minimum payout for SSRF.
Fix
Variants to test
- Submit a URL pointing at
http://localhost:<port>for a range of ports and record response times. A positive result is a clear, repeatable gap between ports that answer quickly and ports that hang until timeout. - Submit a URL to a host you control and watch for the incoming request. A positive result is a request arriving from the server, confirming the fetch happens server-side.
- Submit URLs with different file extensions and paths, as was done with
/img.jpgon the Collaborator link. A positive result is the fetch still happening with an image extension appended. - Compare the response body for a public file such as a favicon against a localhost URL. A positive result is base64 content for the public file and an empty body for localhost.
What happened, in plain words
A security researcher was testing a website that let people upload a picture for their organisation, or paste a link to a picture instead of uploading a file. When you paste a link, the website's own computer (the server) goes and fetches that picture for you. The researcher found that the server would happily fetch links pointing at itself, and that by watching how long each fetch took, they could work out which of the server's internal network doors (ports) were open. That is a port scan, done through a picture link. The bug class is called server-side request forgery, or SSRF.
This article walks through the same steps for someone who has never done security testing before. Every term is explained the first time it appears, and every request is shown exactly as it was used.
The background you need first
Before the steps, a few ideas. If you already know them, skip ahead.
Server and client. Your browser is the client: it asks for things. The server is the computer that holds the website and answers. When you paste an image link into a form, normally your browser would download the picture. In this feature, the server downloads it instead, so the picture can be stored on the site.
URL. The address of something on the internet, like https://example.com/img.jpg. It has a scheme (https), a host (example.com) and a path (/img.jpg).
HTTP request and GET. The language browsers and servers speak. A GET request means "give me this thing". It is the kind of request your browser makes when you open a page or load a picture.
Parameter. Extra information attached to a request, written as name=value. In this report the parameter is called iurl and its value is the image link. Think of a form field: the field's name is the parameter name, what you type is the value.
API. A way for one piece of software to talk to another, without a human clicking. When the website's server fetches your image link, it is effectively calling out to another server on your behalf. That call is the API-like behaviour being abused here.
localhost and ports. Every computer has a private address for talking to itself, localhost, which is the same as [redacted]. A computer runs many services at once, and each one listens on a numbered port. Port 80 is the usual web port, 443 the usual secure web port. A port is either open (something is listening) or closed (nothing is). Think of a building: localhost is the building's own address, and ports are numbered doors. An open door has someone behind it; a closed one does not.
SSRF. Server-side request forgery. The attacker makes the server send a request to a destination the attacker chooses, rather than to the place the feature intended. If the server can be pointed at its own internal doors, the attacker can probe things that are not reachable from the outside internet.
Blind SSRF. Sometimes the server does make the request, but the answer is not shown back to you. You cannot see what came back, so you have to find another signal. As the report puts it: blind SSRF vulnerabilities arise when an application can be induced to issue a back-end HTTP request to a supplied URL, but the response from the back-end request is not returned in the application's front-end response. In everyday terms: you post a letter for someone else, and you never get to read the reply, only observe whether the postbox was slow.
Burp Collaborator. A service that gives you a unique web address you control, and tells you when something contacts it. If you paste that address into a form and later see a hit, you know the server went and fetched it. It is like a doorbell you can put anywhere to see who rings it.
Autorize. A browser extension used by testers to check whether one user can access another user's data (access control) or change identifiers to reach other records (IDOR, insecure direct object reference). It automates a repetitive check so the tester can browse normally.
Base64. A way of writing binary data, such as an image, as plain text. If a response contains base64, it usually means the server fetched a file and handed its contents back encoded.
Milliseconds (millis). Thousandths of a second. 300 millis is about a third of a second; 1000 millis is one second.
Timeout. When a connection attempt gets no answer, the system waits a while and then gives up. That waiting is what makes a closed port feel slow.
Cross-site scripting (XSS). A different bug where an attacker gets their own code to run in someone else's browser. It is mentioned here only to say it was tried and did not work.
The mindset
The researcher started on a fresh target with lots of features and a few different user roles. They set up Autorize for access-control checks and browsed the application as a normal user would. They tried XSS and could not get it to work anywhere.
The target was in what the report calls qr. Other testers had messaged that they had tested thoroughly and found nothing. The researcher's point is worth keeping: the way one person thinks is different from how others do, so something everyone knows about can still be missed. They decided to test anyway.
Finding the feature
The image upload feature let a user upload an image for their organisation, or submit a link to the image. The link submission is the interesting part, because the server fetches whatever URL you give it. The request was a GET request and the parameter looked like this:
iurl=https://xyz.burpcollab.net/img.jpg
Line by line: iurl is the name of the parameter the form sends. https://xyz.burpcollab.net/img.jpg is the value, a Burp Collaborator address with /img.jpg added on the end. The researcher used their own Collaborator address so that, if the server fetched it, they would see the hit and know the fetch really happened on the server side.
The /img.jpg ending was deliberate. If the site checked that the link looked like an image, ending in an image filename might get past that check. The approach was to first see how the feature is supposed to work, then try to manipulate it. A response came back. On its own this has no impact, because it is a feature working as designed, not a bug.
Escalating it
Step 1: point the fetcher at localhost
Reading around for ways to escalate, the researcher tried the localhost address:
url=http://localhost:80
Line by line: url is the parameter name as written in this attempt, and http://localhost:80 is the value, meaning "the server's own address, on port 80". Port 80 is the standard web port, so this asks the server to fetch a page from itself.
It gave a response. Servers usually block anything related to localhost, because letting outsiders make the server talk to itself is exactly the kind of thing that leads to trouble. There was no such block here. The response body was not different from before: it simply returned "" in the body of the response. In plain words, the server said "here is your answer" and the answer was an empty string. That tells you the request was made, but not what came back.
Step 2: fetch a known remote file
The next attempt was a well-known file on a public host:
url=http://www.google.com/favicon.ico
Line by line: this asks the server to fetch Google's small site icon, favicon.ico. The point is to use a file that definitely exists and is definitely an image, so you can see what a successful fetch looks like.
This returned the base64 of the favicon. So the server does fetch remote files and does hand back their contents, encoded as text. At this point not much more was done, because whatever was tried, the response threw an error when any other file type was given. The feature only really worked for images, which limited what could be read back.
Step 3: notice the timing difference
Back on localhost testing, the port was changed to 801 and the response was delayed a bit.

Port 801 is not a standard web port.
To confirm, ports that were known to be open, such as 80 and 443, were tried. They responded almost within 300 millis on average, whereas the invalid ones, 801 and 65000, responded after 1000 millis on average. In other words, the request was delayed and timed out on a closed port and replied instantly on an open port.
Why does that happen? When the server tries to connect to a port where something is listening, the connection is accepted straight away and the answer comes back quickly. When it tries a port where nothing is listening, the connection attempt hangs until the system gives up, which took about 1000 millis on average here. The body of the response never changes, but how long it takes to come back does. That timing difference is the oracle: a signal you can read even when the content tells you nothing. It is like knocking on doors in a corridor: an occupied room answers at once, an empty one leaves you standing there.
Why it works
The application takes a user-supplied URL in the iurl parameter and makes a back-end request to it; requests to localhost were not blocked. Requests to localhost were not blocked, so the server could be pointed at its own loopback interface, the private channel a computer uses to talk to itself. Because the response body is not useful (empty for localhost, an error for most file types), the vulnerability is blind, and the only observable signal is response time: a closed port causes the back-end connection attempt to hang until it times out, while an open port answers immediately. The report does not describe the server-side code, so the exact implementation is not known.
What it means in practice
An attacker who can submit an image link can make the server issue requests to localhost and use the response timing to infer which ports are open. In this case the outcome was classified as a port scan, and the researcher received the minimum payout for SSRF. The report does not describe any further escalation beyond port scanning.
The report itself
The researcher wrote the report quickly, excited by the finding, and concentrated on the steps to reproduce. The description and impact sections got only a brief single sentence. Later, with the adrenaline gone, they felt less confident about the write-up even though they were confident about the proof of concept. They were still in qr and could not see whether anyone else had reported the same thing, and did not wait for qr to end to check for duplicates.
At first the report sat in soft reject, which made the researcher think someone else had written a better report. At the final review it was accepted, with the note that the proof of concept made it accepted, probably because others had not noticed the difference in response time. The report was accepted at final review, with the note that the proof of concept made it accepted.
How to fix it
Variants to test
If you want to look for the same thing on a site you are allowed to test, these are the checks described:
- Submit a URL pointing at
http://localhost:<port>for a range of ports and record response times. A positive result is a clear, repeatable gap between ports that answer quickly and ports that hang until timeout. - Submit a URL to a host you control and watch for the incoming request. A positive result is a request arriving from the server, confirming the fetch happens server-side.
- Submit URLs with different file extensions and paths, as was done with
/img.jpgon the Collaborator link. A positive result is the fetch still happening with an image extension appended. - Compare the response body for a public file such as a favicon against a localhost URL. A positive result is base64 content for the public file and an empty body for localhost.
Glossary
- Autorize: a browser extension that automates access-control and IDOR checks while a tester browses.
- Blind SSRF: SSRF where the server makes the request but the answer is not shown back to the attacker.
- Burp Collaborator: a service that gives you a unique address and tells you when something contacts it.
- Client: the program asking for things, usually your browser.
- Closed port: a numbered door on a computer where nothing is listening.
- Cross-site scripting (XSS): a bug where an attacker gets their code to run in someone else's browser.
- GET request: an HTTP request meaning "give me this thing".
- HTTP: the language browsers and servers use to exchange requests and responses.
- IDOR: insecure direct object reference, where changing an identifier lets you reach another user's record.
- localhost: the private address a computer uses to talk to itself, the same as
[redacted]. - Open port: a numbered door on a computer where a service is listening and will answer.
- Oracle: any observable signal, such as timing, that reveals something the response content does not.
- Parameter: extra information attached to a request as
name=value. - Port: a numbered channel on a computer that a service listens on, such as 80 for web or 443 for secure web.
- Port scan: probing a range of ports to learn which are open.
- qr: the quiet period during a test when results are not yet visible to other testers.
- Server: the computer that holds a website and answers requests.
- SSRF: server-side request forgery, making a server send a request to a destination the attacker chooses.
- Timeout: giving up on a connection attempt after waiting a while with no answer.
- URL: the address of something on the internet, with a scheme, host and path.