SSRFing External Service Interaction and Out of Band Resource Load (Hacker's Edition)
External Service Interaction & Out-of-Band Resource Loads
In the recent past we encountered two relatively new types of attacks: External Service Interaction (ESI) and Out-of-Band Resource Loads (OfBRL).
- An ESI [1] occurs only when a web application allows interaction with an arbitrary external service.
- OfBRL [6] arises when it is possible to induce an application to fetch content from an arbitrary external location, and incorporate that content into the application's own response(s).
The Problem with OfBRL
The ability to request and retrieve web content from other systems can allow the application server to be used as a two-way attack proxy (when OfBRL is applicable) or a one-way proxy (when ESI is applicable). By submitting suitable payloads, an attacker can cause the application server to attack, or retrieve content from, other systems that it can interact with. This may include public third-party systems, internal systems within the same organization, or services available on the local loopback adapter of the application server itself. Depending on the network architecture, this may expose highly vulnerable internal services that are not otherwise accessible to external attackers.
The Problem with ESI
External service interaction arises when it is possible to induce an application to interact with an arbitrary external service, such as a web or mail server. The ability to trigger arbitrary external service interactions does not constitute a vulnerability in its own right, and in some cases might even be the intended behavior of the application. However, in many cases, it can indicate a vulnerability with serious consequences.
The Verification
We do not have ESI or OfBRL when:
- In Collaborator, the source IP is our browser IP (the server didn't make the request).
- There is a 302 redirect from our host to the Collaborator (i.e. our source IP appears in the Collaborator logs, not the server's).
Below we can see the original configuration in the repeater, followed by the modified configuration for the test. In the original request, the Host header reflects the legitimate domain. In the test request, we replace it with our Collaborator payload or target host.
Original request
Malicious requests
If the application is vulnerable to OfBRL, the reply is going to be processed by the vulnerable application, bounce back to the sender (the attacker) and potentially load in the context of the application. If the reply does not come back to the sender, then we might have an ESI, and further investigation is required.
The RFCs Updated
It usually is a platform issue and not an application one. In some scenarios when we have, for example, a CGI application, the HTTP headers are handled by the application (i.e. the app is dynamically manipulating the HTTP headers to run properly). This means that HTTP headers such as Location and Host are handled by the app and therefore a vulnerability might exist. It is recommended to run HTTP header integrity checks when you own a critical application that is running on your behalf.
For more information on the subject, read RFC 9110 (HTTP Semantics, June 2022) [2] and RFC 9112 (HTTP/1.1 Message Syntax and Routing) [2b], which supersede the obsolete RFC 2616. The Host request-header field specifies the Internet host and port number of the resource being requested, as obtained from the original URI. The Host field value MUST represent the naming authority of the origin server or gateway given by the original URL. This allows the origin server or gateway to differentiate between internally-ambiguous URLs, such as the root "/" URL of a server for multiple host names on a single IP address.
When TLS is enforced throughout the whole application (even the root path /), an ESI or OfBRL is significantly harder to exploit, because TLS performs source origin authentication — as soon as a connection is established with an IP, the protocol guarantees that the connection will serve traffic only from the original certificate holder. More specifically, we are going to get an SNI error.
SNI prevents what's known as a "common name mismatch error": when a client device reaches the IP address of a vulnerable app, but the name on the TLS certificate doesn't match the name of the website. SNI was added to the IETF's Internet RFCs in June 2003 through RFC 3546, with the latest version in RFC 6066. The current TLS 1.3 specification is RFC 8446 [10].
The option to trigger an arbitrary external service interaction does not constitute a vulnerability in its own right, and in some cases it might be the intended behavior of the application. But we as hackers want to exploit it — what can we do with an ESI or an Out-of-Band Resource Load?
The Infrastructure
Well, it depends on the overall setup. The highest-value scenarios are the following:
- The application is behind a WAF (with restrictive ACLs)
- The application is behind a UTM (with restrictive ACLs)
- The application is running multiple applications in a virtual environment
- The application is running behind a NAT
- The application runs in a cloud environment with metadata endpoints accessible from localhost
- The application runs in a containerized environment (Docker/Kubernetes) with internal service discovery
In order to perform the attack, we simply inject our host value in the HTTP Host header (hostname including port).
The Test
Burp Professional edition has a feature named Collaborator. Burp Collaborator is a network service that Burp Suite uses to help discover vulnerabilities such as ESI and OfBRL [3]. A typical example would be to use Burp Collaborator to test if ESI exists.
Burp Collaborator request
Burp Collaborator response
The Post Exploitation
As hacker-artists, we now think about how to exploit this. The scenarios are: [7] [8]
- Attempt to load the local admin panels.
- Attempt to load the admin panels of surrounding applications.
- Attempt to interact with other services in the DMZ.
- Attempt to port scan localhost.
- Attempt to port scan DMZ hosts.
- Use it to exploit IP trust and run a DoS attack against other systems.
- Access cloud metadata endpoints to extract IAM credentials or instance identity tokens.
- Probe Kubernetes API or container sidecar services (e.g. Envoy admin on localhost:15000).
A good tool for automating this is Burp Intruder [4]. Using Sniper mode, we can:
- Rotate through different ports, using the vulnapp.com domain name.
- Rotate through different ports, using the vulnapp.com external IP.
- Rotate through different ports, using the vulnapp.com internal IP, if applicable.
- Rotate through different internal IPs in the same domain, if applicable.
- Rotate through different protocols (may not always work).
- Brute-force directories on identified DMZ hosts.
Burp Intruder — scanning surrounding hosts
Burp Intruder — port scanning surrounding hosts
Burp Intruder — port scanning localhost
Modern Attack Vectors New 2026
Since the original publication of this article, several high-impact attack surfaces have emerged that directly exploit ESI/OfBRL primitives:
Cloud metadata endpoint exploitation
Cloud providers expose instance metadata via link-local addresses. When a vulnerable application can be coerced into making requests to these endpoints via Host header injection, an attacker can extract IAM credentials, service account tokens, instance identity documents, and network configuration details.
Container and Kubernetes exploitation
In containerized environments, the application server often has network access to internal Kubernetes services that are never meant to be internet-facing:
Practical cache poisoning (Kettle, 2018)
James Kettle's 2018 PortSwigger research on practical web cache poisoning significantly expanded the attack surface understanding for Host header injection. His work demonstrated that unkeyed HTTP headers (including Host, X-Forwarded-Host, and X-Forwarded-Scheme) can be used to poison shared caches (CDNs, reverse proxies) at scale, affecting all users served by the poisoned cache entry. This research formalized the technique that was previously theoretical into a repeatable, high-impact attack chain.
What Can You Do
The full exploitation analysis — this vulnerability can be used in the following ways:
- Bypass restrictive UTM ACLs
- Bypass restrictive WAF rules
- Bypass restrictive firewall ACLs
- Perform cache poisoning
- Fingerprint internal infrastructure
- Perform DoS exploiting IP trust
- Exploit applications hosted on the same machine (multiple app loads)
- Extract cloud IAM credentials via metadata endpoints
- Map Kubernetes cluster topology via internal service discovery
- Exfiltrate data through DNS-based out-of-band channels
The impact of a maliciously constructed response can be magnified if it is cached either by a shared web cache or the browser cache of a single user. If a response is cached in a shared web cache, such as those commonly found in proxy servers or CDNs, then all users of that cache will continue to receive the malicious content until the cache entry is purged. Similarly, if the response is cached in the browser of an individual user, that user will continue to receive the malicious content until the cache entry expires [5].
What Can't You Do
You cannot perform XSS or CSRF exploiting this vulnerability, unless certain conditions apply (e.g. the poisoned response injects attacker-controlled JavaScript into a cached page, or the application reflects the Host header value into HTML output without encoding).
The Fix Updated
If the ability to trigger arbitrary ESI or OfBRL is not intended behavior, then you should implement a whitelist of permitted URLs, and block requests to URLs that do not appear on this whitelist [6]. Running host integrity checks is also recommended.
Review the purpose and intended use of the relevant application functionality, and determine whether the ability to trigger arbitrary external service interactions is intended behavior. If so, be aware of the types of attacks that can be performed via this behavior and take appropriate measures. These measures might include blocking network access from the application server to other internal systems, and hardening the application server itself to remove any services available on the local loopback adapter.
More specifically, we can:
- Apply egress filtering on the DMZ
- Apply egress filtering on the host (iptables/nftables rules, or cloud security group outbound rules)
- Apply whitelist IP restrictions in the application
- Apply blacklist restrictions in the application (not recommended — incomplete by nature)
- Validate and normalize the Host header at the reverse proxy layer before it reaches the application (e.g. Nginx
server_namedirective with explicit hostnames, reject requests with unknown Host values) - Use
X-Forwarded-Hostwith strict allowlisting rather than trusting the raw Host header — and ensure the reverse proxy strips any client-suppliedX-Forwarded-*headers before adding its own - Enforce IMDSv2 on cloud instances (hop limit = 1, PUT-based token acquisition) to block Host header SSRF to metadata endpoints
- Apply Kubernetes NetworkPolicies to restrict pod-to-pod and pod-to-service communication to only what's necessary
- Deploy egress proxies for any application that legitimately needs to make outbound HTTP requests — force all outbound traffic through a proxy with domain allowlisting
References
- portswigger.net — External Service Interaction (DNS)
- RFC 9110 — HTTP Semantics (June 2022) — supersedes RFC 2616
- RFC 9112 — HTTP/1.1 Message Syntax and Routing (June 2022)
- portswigger.net — Burp Collaborator
- portswigger.net — Burp Intruder
- owasp.org — Cache Poisoning
- portswigger.net — Out-of-Band Resource Load (HTTP)
- CWE-918: Server-Side Request Forgery (SSRF)
- CWE-406: Insufficient Control of Network Message Volume
- CWE-441: Unintentional Proxy or Intermediary
- RFC 8446 — TLS 1.3 (August 2018)
- RFC 6066 — TLS Extensions (January 2011) — SNI
- cloudflare.com — What is SNI?
- portswigger.net — Practical Web Cache Poisoning (Kettle, 2018)
- OWASP Top 10 2021 — A10: SSRF