Skip to content
SSRF Write-up Intermediate

Blind SSRF Without Callbacks: How I Used Timing to Prove Kubernetes and AWS Metadata Access

A migration checklist endpoint accepted a database connection URI and made a server-side TCP connection to it, allowing an attacker to probe internal network addresses. By measuring response times against a baseline, the author showed that the Kubernetes API server, AWS and GCP metadata services, and localhost Redis and PostgreSQL were reachable.

Nizar Kadiri Follow

Published on medium.com

Cybersec

Nizar Kadiri, 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.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 6 min read.

Context

The target was a cloud-native developer platform, and the surface was its console API. The feature in question is a migration checklist endpoint: it accepts a connection_uri in the POST body, a standard database connection string, and uses it server-side to attempt a connection and validate a migration setup. The design intent is reasonable. The platform helps users verify their database configuration before running a migration, and to do that it makes a real outbound TCP connection to whatever host and port the supplied URI names.

That same behaviour is what makes the endpoint an SSRF candidate. The response body tells the client nothing about whether the connection succeeded, what it reached, or what came back, so this is blind SSRF territory. The write-up shows how to confirm it without any out-of-band callback infrastructure, using response time differentials alone, and how to use those differentials to prove reachability of the Kubernetes API server, the AWS and GCP instance metadata services, and localhost services on the same host as the application.

Setup

The testing was done against researcher-owned accounts within the program's defined scope. No production data was accessed or exfiltrated, and internal services were confirmed reachable via timing only, without being probed beyond establishing TCP reachability.

The tooling was curl, with a session cookie supplied in a Cookie header and a JSON body. The report does not give the full endpoint URL, the platform version, or the exact account roles used.

Finding it

During recon on the platform's console API the researcher came across the migration checklist endpoint. It took a connection_uri in the POST body and used it server-side to attempt a connection and validate a migration setup.

The reasoning is general: any endpoint that takes a URI and makes a server-side network connection based on it is worth testing for SSRF. The feature's usefulness depends on making a real outbound TCP connection to an arbitrary host and port, which is exactly what makes it dangerous when the input is not validated. The response body gave no signal about success, destination or content, so the usual confirmation route, a callback to Burp Collaborator or interactsh, was not the only option. The researcher chose timing instead.

Exploitation

The technique rests on a simple difference in behaviour. When the server connects to a host that exists and is reachable, the TCP handshake completes in milliseconds and the application gets a response or an application-level error almost immediately. When the host does not exist or is filtered at the network layer, the connection attempt hangs until a timeout fires, usually somewhere between 30 and 120 seconds depending on server configuration. A fast response to an internal address against a slow response to an unreachable control address is proof of network-layer access, without any external callback.

The method only works with a reliable baseline, so the baseline came first.

Step 1: Establish the baseline

The control was an RFC-1918 address that almost certainly does not exist in the target's infrastructure, a private IP in a range unlikely to be allocated. The request measured total time with curl's -w format string.

Bash
curl 'https:  -H 'Cookie: keycloak_token=[YOUR_TOKEN]' \  -H 'Content-Type: application/json' \  -d '{"connection_uri":"postgres://x:[redacted]:5432/db"}' \  -w '\nTime: %{time_total}s\n'

The connection_uri points at [redacted]:5432, a private address used purely as an unreachable control. The result:

Text
# HTTP 524 — timeout after ~100 seconds

One hundred seconds to time out is the ceiling. Any internal address that responds meaningfully faster than that is reachable.

Step 2: The Kubernetes API server

kubernetes.default.svc.[redacted] is the internal DNS name that resolves to the Kubernetes API server from within any pod in the default namespace. It is a standard name that works across any Kubernetes deployment, and if the application runs inside a cluster, which is likely for a modern cloud-native platform, it resolves and is reachable on port 443.

Text
-d '{"connection_uri":"postgres://x:[redacted]:443/db"}'
Text
# HTTP 200 OK# Time: 0.36s

0.36 seconds against a 100 second baseline is a 278x timing differential. The Kubernetes API server is reachable from within the application's network context.

Step 3: AWS and GCP instance metadata services

[redacted] is the link-local address of the AWS Instance Metadata Service. On any EC2 instance or EKS node it is reachable and returns IAM role credentials, instance identity documents and other sensitive configuration. The GCP equivalent was tested as well.

Text
-d '{"connection_uri":"postgres://x:[redacted]:80/db"}'
Text
# GCP metadata service-d '{"connection_uri":"postgres://x:[redacted]:80/db"}'# Time: 0.37s — reachable

Both metadata services responded in under a second. On a platform that describes itself as cloud-native and supports multiple cloud providers, fast responses from both AWS and GCP metadata endpoints suggest the application may span infrastructure across both clouds, or at minimum that the network configuration permits access to both.

Step 4: Localhost services

Common localhost ports were probed next. Redis on 6379 and PostgreSQL on 5432 both responded in under half a second.

Text
-d '{"connection_uri":"postgres://x:[redacted]:6379/db"}'
Text
# Localhost PostgreSQL-d '{"connection_uri":"postgres://x:[redacted]:5432/db"}'# Time: 0.41s — reachable

Redis and PostgreSQL running on the same host as the API server is not surprising for a database platform, but it means SSRF to localhost is not only about reaching metadata services. It is about reaching the application's own data layer directly.

Step 5: The full picture

The timing summary across all tested targets:

Text
kubernetes.default.svc.[redacted]:443   0.36s   reachablemetadata.[redacted]:80               0.37s   reachable127.0.0.1:5432 (PostgreSQL)               0.41s   reachable127.0.0.1:6379 (Redis)                    0.47s   reachable169.254.169.254:80 (AWS IMDS)             0.53s   reachable10.0.0.1:5432 (unreachable baseline)      100s+   not reachable

Five internal targets, all sub-second, against one baseline at 100 seconds. The PoC was confirmed through triage.

Root cause

The endpoint takes a user-supplied URI and makes a server-side TCP connection to the host and port it names, without validating the destination. The feature's purpose requires that behaviour, so the risk is not in the intent but in the behaviour: the server will connect to whatever address the input specifies, including cluster-internal names, link-local metadata addresses and loopback. The report does not describe any allowlist, address filtering or egress restriction.

Impact

An attacker who can reach this endpoint can use it to reach internal services from the application's network context. Against the Kubernetes API server, a more sophisticated attacker could chain the SSRF with Kubernetes API access to enumerate cluster secrets, steal service account tokens from the pod's mounted credentials, or query the API for sensitive workload metadata. The SSRF is the entry point; the Kubernetes API is what makes it serious. Against the metadata services, the AWS IMDS returns IAM role credentials, instance identity documents and other sensitive configuration. Against localhost, the application's own data layer is directly reachable.

The report confirms reachability by timing only and does not demonstrate retrieval of any of these resources. The impact described is what the reachability would enable, not what was extracted.

Fix

Variants to test

  1. Any endpoint that accepts a URI and makes a server-side connection: database connection checkers, webhook testers, import-by-URL features, image fetchers. A positive result is a sub-second response to an internal address against a slow response to an unreachable control.
  2. Kubernetes service DNS names such as kubernetes.default.svc.[redacted] on port 443. A positive result is a fast response where the baseline times out.
  3. Cloud metadata addresses, [redacted] on port 80 and metadata.[redacted] on port 80. A positive result is a sub-second response.
  4. Loopback ports for common services, such as 6379 and 5432 on [redacted]. A positive result is a response in under half a second.
  5. Always measure an unreachable RFC-1918 control first. A positive result is a large, consistent differential across several independent internal targets, which is much harder to dismiss than a single fast response.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 16 min read.

What happened, in plain words

A security researcher found a way to make a company's web server secretly connect to other computers on its own internal network, computers that people outside the company are never supposed to reach. The feature he abused was a harmless-looking migration checklist endpoint that checks database settings. The server did what it was told: it tried to connect to whatever address was typed in. The researcher typed in addresses of internal machines, and the server obediently tried to reach them.

The tricky part is that the server never told him whether the connection worked. The reply told him nothing about whether the connection worked. So he could not simply read a success message. Instead he used a stopwatch: a machine that exists answers in a fraction of a second, while a machine that does not exist leaves the server waiting until it gives up, about a hundred seconds later. By comparing those times he could prove which internal machines the server could reach, without ever seeing their contents.

This is called a blind SSRF, and the write-up shows how he proved it reached the Kubernetes API server, the cloud metadata services of AWS and GCP, and database services running on the same machine as the application.

Photo by Aron Visuals on Unsplash From the original on medium.com

The words you need first

Before the steps make sense, here are the ideas the whole story rests on. Each one is explained from zero.

  • Server: a computer somewhere in a data centre that runs a website or service. When you click something, your browser sends a request to a server and the server sends back an answer.
  • API: a way for one program to talk to another, without a human clicking buttons. Think of a restaurant: the menu is the API, you order from it, and the kitchen (the server) prepares the dish. A console API is the API behind a company's management dashboard, the place where customers configure their account.
  • Endpoint: one specific address inside an API, like one particular counter at a service desk. Each endpoint does one job, for example "check my migration setup".
  • POST body: when your browser sends data to a server, the data can travel in the body of the request, the way a letter travels inside an envelope. A POST request is the kind used when you are submitting information rather than just asking for a page.
  • URI / URL: the address of a resource. https://example.com/page is a URL. A connection string is a special URI that also carries the details needed to connect to a database: the address, the port, and a username and password.
  • Port: a numbered door on a computer. One machine can run many services, each listening on its own door. Web traffic usually uses port 443 (encrypted) or 80 (plain), PostgreSQL databases often use 5432, and Redis often uses 6379.
  • TCP connection: the basic handshake two computers perform before they exchange data, like knocking on a door and waiting for someone to open it. If the door opens quickly, the machine is there. If nobody answers, you stand there until you decide to leave.
  • Timeout: the moment a program stops waiting. If a connection attempt gets no answer, the server eventually gives up, usually after 30 to 120 seconds depending on how it is configured.
  • SSRF (Server-Side Request Forgery): a vulnerability where an attacker can make the server send a request to an address the attacker chooses. The attacker is not connecting directly; the server is doing it on their behalf, from inside the company's network where the attacker could never go.
  • Blind SSRF: an SSRF where the attacker gets no useful content back. The server makes the connection but tells you nothing about what it found. You have to find indirect evidence.
  • Cookie / token: a small piece of text your browser stores after you log in, and sends with every request so the server knows who you are. A session cookie is like a wristband at an event: show it and you get in without proving your identity again. A token such as keycloak_token is the same idea in a different format.
  • curl: a command-line tool for sending HTTP requests by hand. It lets you build a request exactly as you want, which is useful when a browser's buttons do not expose the option you need.
  • Header: extra information attached to a request, separate from the body. Content-Type: application/json tells the server "the body is JSON", and Cookie carries your login token.
  • JSON: a simple text format for structured data, using curly braces and quoted names, for example {"name":"value"}.
  • Kubernetes: software that runs and manages many containers (small packaged applications) across a group of machines, called a cluster. It has its own API server that controls the whole cluster.
  • Pod: the smallest unit Kubernetes runs, one or more containers sharing a network address. Applications inside a cluster talk to each other using internal names that only exist inside the cluster.
  • Instance metadata service: a special address that cloud providers make available to every virtual machine. It hands out information about the machine, including temporary credentials for the cloud account. It is meant to be reachable only from the machine itself, never from the internet.
  • Localhost / loopback: the address [redacted] always means "this same computer". A service listening there is only reachable from the machine itself, not from outside.
  • RFC-1918 address: a range of private addresses reserved for internal networks, such as [redacted]. They are not routable on the public internet, so they are a good choice for a control address that should be unreachable.
  • Baseline / control: a measurement you take on something you know the answer to, so you can compare later results against it. Without a baseline, a fast response means nothing.
  • PoC (proof of concept): a demonstration that a vulnerability is real, usually the smallest set of steps that shows it.
  • Triage: the stage where the company's security team reviews a report and decides whether it is valid.

Finding the surface

The researcher was exploring the platform's console API, the set of endpoints behind the management dashboard. During this exploration, called recon (short for reconnaissance), he came across a migration checklist endpoint.

A migration, in this context, means moving a customer's database from one place to another. Before running a migration, the platform offers to check that the customer's database settings are correct. To do that, the server takes the connection string the customer supplied and actually tries to connect to it. If the connection works, the settings are probably fine.

That is a completely reasonable feature. It is also exactly the kind of feature that can be turned against the platform. The endpoint accepts a connection_uri in the POST body, a standard database connection string, and uses it server-side to attempt a connection and validate a migration setup. The server will connect to whatever host and port the string names.

Any endpoint that takes a URI and makes a server-side network connection based on it is worth testing for SSRF. The design intent here was reasonable, but the behaviour that makes the feature useful, making a real outbound TCP connection to whatever host and port you specify, is exactly what makes it dangerous if the input is not validated.

The response body was useless for SSRF testing. It told the researcher nothing about whether the connection succeeded, what it reached, or what was returned. That is standard blind SSRF territory.

Why timing works here

When a server tries to connect to a host that exists and is reachable, the TCP handshake completes quickly, within milliseconds, and the application gets a response or an application-level error almost immediately. When it tries to connect to a host that does not exist or is filtered at the network layer, the connection attempt hangs until a timeout fires. Depending on the server's configuration, that timeout is usually somewhere between 30 and 120 seconds.

That gap is your signal. If an internal address returns in 0.4 seconds and an unreachable control address returns in 100+ seconds, that is not noise. That is proof of network-layer access, without a single external callback.

A callback, in this context, means an external service you control that records incoming connections. The usual way to confirm an SSRF is to point the target at such a listener and wait for a ping. That works when the target can reach the internet and when you have such a service set up. Timing needs neither. It only needs a stopwatch and a comparison.

The technique works best when you can establish a reliable baseline first, which is exactly what the researcher did.

Establishing the baseline

Before testing any interesting internal addresses, he needed a control: an RFC-1918 address that almost certainly does not exist in the target's infrastructure. He used a private IP in a range unlikely to be allocated and measured how long the request took to complete.

Bash
curl 'https:  -H 'Cookie: keycloak_token=[YOUR_TOKEN]' \  -H 'Content-Type: application/json' \  -d '{"connection_uri":"postgres://x:[redacted]:5432/db"}' \  -w '\nTime: %{time_total}s\n'

Line by line:

  1. curl is the tool being run. Everything after it is an instruction about what request to send.
  2. 'https: is the beginning of the endpoint address. The report shows it truncated, so the full URL is not given here.
  3. -H 'Cookie: keycloak_token=[YOUR_TOKEN]' attaches a header carrying the login token, so the server treats the request as coming from a logged-in user. The token itself has been replaced with a placeholder.
  4. -H 'Content-Type: application/json' tells the server that the body is JSON, so it knows how to read it.
  5. -d '{"connection_uri":"postgres://x:[redacted]:5432/db"}' is the body. It contains one field, connection_uri, whose value is a PostgreSQL connection string. Read it as: connect to host [redacted], port 5432, database db, with username x and password x. The username and password are placeholders; the point is the address.
  6. -w '\nTime: %{time_total}s\n' makes curl print the total time the request took, in seconds, after the response. This is the stopwatch.

The address [redacted] is a private address chosen because it almost certainly does not exist in the target's network. Nothing should answer there, so the request should hang until the server gives up.

Text
# HTTP 524 — timeout after ~100 seconds

HTTP 524 was returned, a timeout after about 100 seconds. One hundred seconds to time out is the ceiling. Any internal address that responds meaningfully faster than that is reachable.

Why this step matters: without this number, a fast response later would be meaningless. Maybe the server always answers in under a second. The baseline rules that out.

Test 1: The Kubernetes API server

kubernetes.default.svc.[redacted] is the internal DNS name that resolves to the Kubernetes API server from within any pod in the default namespace. It is a standard name that works across any Kubernetes deployment. If the application is running inside a cluster, which is likely for any modern cloud-native platform, this address will resolve and be reachable on port 443.

In plain words: inside a Kubernetes cluster, every application can find the cluster's control centre by this fixed name. From outside the cluster, the name means nothing. If the server can reach it, the server is inside the cluster and can talk to the control centre.

Text
-d '{"connection_uri":"postgres://x:[redacted]:443/db"}'

This is the same body as before, with the address swapped. The connection string now points at the Kubernetes API server's internal name on port 443, the port used for encrypted web traffic. The username and password are placeholders; the address is the point. The only question is whether the connection is made at all, and how quickly.

Text
# HTTP 200 OK# Time: 0.36s

The response came back in 0.36 seconds. Against a 100 second baseline that is a 278x timing differential. The Kubernetes API server is reachable from within the application's network context.

What that means in practice: a more sophisticated attacker could chain this SSRF with Kubernetes API access to enumerate cluster secrets, steal service account tokens from the pod's mounted credentials, or query the API for sensitive workload metadata. The SSRF is the entry point; the Kubernetes API is what makes it serious.

Test 2: AWS and GCP instance metadata services

[redacted] is the link-local address of the AWS Instance Metadata Service. On any EC2 instance or EKS node it is reachable and returns IAM role credentials, instance identity documents, and other sensitive configuration. The GCP equivalent was tested as well.

In plain words: cloud providers give every virtual machine a secret back door at a fixed address that only the machine itself can use. Through it, the machine can ask "who am I and what am I allowed to do?" and receive temporary credentials. If an outsider can make the server knock on that door, the credentials may be within reach.

Text
-d '{"connection_uri":"postgres://x:[redacted]:80/db"}'

Again the same body, now pointing at the AWS metadata address on port 80, the plain web port. The timing tells us whether the address answered.

Text
# GCP metadata service-d '{"connection_uri":"postgres://x:[redacted]:80/db"}'# Time: 0.37s — reachable

This block shows the GCP test: the same body with the address metadata.[redacted], Google Cloud's equivalent internal name, on port 80. The recorded time was 0.37 seconds, marked reachable.

Both metadata services responded in under a second. On a platform that describes itself as cloud-native and supports multiple cloud providers, getting fast responses from both AWS and GCP metadata endpoints suggests the application may span infrastructure across both clouds, or at minimum that the network configuration permits access to both.

Test 3: Localhost services

He also probed common localhost ports. Redis on 6379 and PostgreSQL on 5432 both responded in under half a second.

Localhost, [redacted], always means the same machine that is making the request. A service listening there is not exposed to the internet at all. If the server can reach it, the server can talk to services on its own machine that nobody outside was meant to touch.

Text
-d '{"connection_uri":"postgres://x:[redacted]:6379/db"}'

This body points at [redacted] on port 6379, the usual port for Redis, a fast in-memory data store often used for caching and queues. The connection string still says postgres, but the port is what decides which service is contacted.

Text
# Localhost PostgreSQL-d '{"connection_uri":"postgres://x:[redacted]:5432/db"}'# Time: 0.41s — reachable

This block shows the second localhost test, on port 5432, the usual PostgreSQL port. It came back in 0.41 seconds, marked reachable.

Redis and PostgreSQL running on the same host as the API server is not surprising for a database platform. But it means that SSRF to localhost is not just about reaching metadata services. It is about reaching the application's own data layer directly.

The full picture

Here is the timing summary across all tested targets:

Text
kubernetes.default.svc.[redacted]:443   0.36s   reachablemetadata.[redacted]:80               0.37s   reachable127.0.0.1:5432 (PostgreSQL)               0.41s   reachable127.0.0.1:6379 (Redis)                    0.47s   reachable169.254.169.254:80 (AWS IMDS)             0.53s   reachable10.0.0.1:5432 (unreachable baseline)      100s+   not reachable

Each line is one target, the time it took, and whether it was reachable. Five internal targets, all sub-second. One baseline, 100 seconds. The PoC was confirmed through triage.

Why the table matters: a single fast response could be a fluke. Five independent internal targets all clustering in the same sub-second range, against a baseline that times out at 100 seconds, is a pattern that is hard to explain away.

Why timing-based proof is underused

Most hunters reach for external callbacks first because they are easier to interpret. You see a DNS ping, you know the server made an outbound request. That is clean evidence.

But timing oracles give you something callbacks cannot always give you: proof of what is reachable inside the internal network, not just proof that outbound requests are made. The Kubernetes API server and localhost Redis are not going to make DNS requests to your collaborator instance. Timing is how you prove you can reach them.

The key is always establishing the baseline first. Without it, a 0.4 second response time means nothing. With it, it means everything. And when you have five separate internal targets all clustering in the same sub-second range against a 100 second unreachable baseline, the statistical argument is hard to dismiss. A 278x differential is not a coincidence.

What I took from this

Any endpoint that accepts a URI and makes a server-side connection is an SSRF candidate. It does not matter if the feature looks benign; checking a database connection is a completely reasonable product feature. The risk is not in the intent, it is in the behaviour.

When response bodies give you nothing, think about what else the server is telling you. Timing is information. Error messages are information. Response sizes are information. Blind does not mean you are working without evidence. It just means the evidence is less obvious than a DNS ping in your collaborator dashboard.

And when you write the report, put the numbers in a table. "It responded faster for internal addresses" is easy to dismiss. "278x timing differential across five independent targets with a documented baseline" is not.

All testing was conducted against researcher-owned accounts within the program's defined scope. No production data was accessed or exfiltrated. Internal services were confirmed reachable via timing only and were not probed beyond establishing TCP reachability.

Glossary

  • API: a way for one program to talk to another, with defined addresses and formats for requests and answers.
  • Baseline (control): a measurement taken on something whose result you already know, used for comparison.
  • Blind SSRF: an SSRF where the server makes the connection but returns no useful information about the result.
  • Callback: an external service you control that records incoming connections, used to confirm that a target made a request.
  • Connection string: a URI that carries the address, port, username and password needed to connect to a database.
  • Cookie: a small piece of text a browser stores and sends with requests so the server can recognise the user.
  • DNS: the system that turns names like metadata.[redacted] into network addresses.
  • Endpoint: one specific address inside an API that performs one job.
  • Header: extra information attached to an HTTP request or response, separate from the body.
  • HTTP status code: a number in the response saying how the request went, such as 200 for success or 524 for a timeout at the proxy.
  • Instance metadata service: a fixed internal address cloud providers expose to virtual machines, returning information and temporary credentials about the machine.
  • JSON: a text format for structured data using braces, quotes and colons.
  • Kubernetes: software that runs and manages containers across a cluster of machines.
  • Kubernetes API server: the control centre of a Kubernetes cluster, reachable inside the cluster at kubernetes.default.svc.[redacted].
  • Link-local address: an address valid only on the local network segment, such as [redacted].
  • Localhost / loopback: the address [redacted], meaning the same machine that is making the request.
  • PoC (proof of concept): a demonstration that a vulnerability is real.
  • Port: a numbered door on a computer that a particular service listens on.
  • POST body: the part of an HTTP request that carries submitted data.
  • Recon: reconnaissance, the exploratory phase of looking for things worth testing.
  • RFC-1918 address: a private address range such as [redacted], not routable on the public internet.
  • Server: a computer that runs a service and answers requests.
  • Session cookie / token: a credential stored after login and sent with later requests to prove identity.
  • SSRF (Server-Side Request Forgery): a vulnerability where an attacker makes the server send a request to an address of the attacker's choosing.
  • TCP: the protocol two computers use to establish a connection before exchanging data.
  • Timeout: the point at which a program stops waiting for an answer.
  • Triage: the review stage where a security team decides whether a report is valid.
  • URI / URL: the address of a resource; a URL is the common form used on the web.

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.