Skip to content
Putting technology to work.
Insights to guide decisions and action.

Search articles

Closing the door on internal network probing — Making SSRF mitigation standard practice in client architecture

Table of contents · 5 items

"Input an icon image URL, and the server fetches and displays it"—a ubiquitous feature. Yet this seemingly ordinary process can become a gateway for attackers to pivot through the server to inspect internal networks. If an entered URL points to a cloud metadata endpoint (yielding credentials) or internal APIs hidden from the outside world, the application blindly accesses it and returns the result. This is Server-Side Request Forgery (SSRF).

While it might seem like an inconspicuous vulnerability, the damage escalates dramatically in cloud environments. If temporary cloud credentials are leaked via metadata, attackers can move laterally. That is why defense standardization is accelerating; for example, Spring Boot 4.1, released in June 2026, embedded SSRF mitigation into its HTTP client. Frameworks are moving toward blocking dangerous destinations by default. Even so, areas that cannot be left entirely to frameworks always remain for custom development teams.

Where it occurs — every feature accepting a URL is a candidate

SSRF is not confined to special features; it can occur wherever the server initiates external communications based on user-supplied values. Common entry points found in custom development projects include:

FeaturesWhy it leads to SSRF
Image / OGP URL fetchingThe server directly fetches the submitted URL
Webhook registrationThe server periodically sends POST requests to the registered URL
External API proxyingThe server relays requests to a client-specified destination
PDF / thumbnail generationThe renderer resolves URLs embedded in the page
Import features (URL specification)Processing that pulls data from a specified URL

The shared factor is that the destination is ultimately determined by the user. Attackers will supply addresses like http://169.254.169.254/ (cloud metadata), http://localhost:8080/admin, or internal IP addresses. For a broader view of baseline web application attack surfaces, please also refer to Web Security Fundamentals (GH Media).

Mitigating via allowlists and re-validation instead of blocklists

A common misstep in SSRF defense is a blocklist approach that rejects URLs containing localhost or 169.254. This is easily bypassed using DNS rebinding (returning a harmless IP initially and switching to an internal IP upon connection), redirects, IPv6 notations, or decimal representations. To reliably block this every time in custom development, standardize on the following patterns:

  1. Restrict destinations using an allowlist: Whitelist target domains whenever possible. Even for features permitting arbitrary URLs, restrict schemes strictly to https
  2. Validate the resolved IP: Ensure the IP address after DNS resolution is not a private, loopback, or link-local address
  3. Re-validate upon connection: To prevent DNS rebinding where the IP changes between resolution and connection, pin and validate the IP actually being connected to
  4. Do not follow redirects, or re-validate each time: Subject redirect destinations to the same validation to prevent being diverted internally via 3xx status codes
  5. Isolate the outbound origin: Run external retrieval processes from a network segment incapable of reaching cloud metadata or internal APIs

Item five is critical. No matter how thoroughly application code is written, placing outbound processes in a network that cannot reach metadata endpoints acts as the ultimate safeguard. The concept of defense-in-depth through network segmentation was also explored in Multi-Tenant Isolation and Defense in Depth (GH Media).

Eliminating the need to remember every time in custom development

The scary part about SSRF is not its complexity, but that it requires mindful attention from scratch every single time a feature is created. Different developers implementing image fetching, webhooks, or imports can easily lead to missed defenses. When we handle custom development, we do not leave this to individual attentiveness; instead, we provide a shared client or function for secure external fetching and route all URL-handling logic through it. Centralizing validation logic in one place simplifies code reviews to just checking that single integration point.

The idea of systematizing proper implementation every time mirrors our approach in The Problem with Storing JWTs in localStorage (GH Media), regarding token storage locations. Vulnerabilities are less a matter of knowledge and more a matter of standardization.

First, take inventory of features that accept URLs

Identify every place in your system where the server accesses a user-specified URL: image fetching, webhooks, imports—there are likely more than expected. Verify whether each is protected by allowlists and resolved-IP validation, and executed from locations isolated from metadata. In custom development, we assist with this inventory and help standardize validation logic into a centralized solution.

Sources

Share this articleXFacebook
Kakeru Suzuki

Fascinated by the possibilities of technology, has had a deep interest in programming and digital art since student days

Turn this article's theme into your company's next step

Concrete steps forward for your organization.

We organize your desired architecture, legacy systems, and operational requirements to formulate your next steps toward execution.

  • Desired architecture
  • Integration with existing environments
  • Operational requirements
Consult on development & operations initiatives

You can consult with us from the initial conceptual stage. Details from this article will be carried over to the inquiry form.

Receive the latest articles by email