0%
Security Engineering for Software Teams
Thinking About Security
Cryptography You Will Actually Use
Identity
Infrastructure and Cloud
Detection and Response
SSRF, Deserialization and File Upload
Server side request forgery, SSRF, happens when an application fetches a URL or connects to an address that an attacker influences. The request leaves from the server, inside the network, with whatever access the server has. That access often includes internal services, admin interfaces and cloud metadata endpoints that were never meant to be reachable from the internet. SSRF has become one of the most damaging web vulnerabilities in cloud environments because a single fetch can hand an attacker the credentials of the machine that made it. This section explains how SSRF arises, what it can reach and where it hides in ordinary product features.
The basic pattern
Many features take a URL from the user and fetch it on the server: link previews, webhook deliveries, import from URL, avatar uploads by link, PDF and screenshot rendering and image proxies. If the application fetches whatever URL it receives, the attacker can point it at addresses that only the server can reach. The server sends the request with its own network position and sometimes its own credentials, and depending on the feature, returns the response, part of it or at least a signal of success or failure to the attacker.
Why the network position matters
Internal networks are often built on the assumption that anything inside is trusted. Admin dashboards, databases with HTTP interfaces, service discovery endpoints, caches and internal APIs may accept requests without authentication because they are not exposed publicly. SSRF turns the application server into a proxy into that trusted zone. A vulnerability in a low value feature, such as a link preview, can therefore expose systems far more sensitive than the feature itself.
Cloud metadata endpoints
Cloud virtual machines and containers can query a metadata service at a link local address to learn about themselves and obtain temporary credentials for their attached role. If an attacker can make the server fetch that address, they may read those credentials and use them from outside, with every permission the role grants. Several large breaches followed exactly this path. Newer metadata service versions require a session token obtained with a PUT request and a special header, which ordinary SSRF cannot usually supply.
Blind SSRF
Not every SSRF returns the response body. In blind SSRF the attacker learns only whether the request succeeded, how long it took or nothing at all. Blind SSRF can still be dangerous: it can trigger actions on internal services that accept GET requests, map which internal hosts and ports respond and reach services whose effects are visible elsewhere. Defenders should treat blind SSRF as real, not as a curiosity, because many serious chains begin with one.
Where SSRF hides
SSRF appears wherever servers handle URLs or addresses from users. Webhook configuration lets customers enter any callback URL. Document converters fetch images and stylesheets referenced inside uploaded files. XML parsers can fetch external entities. Single sign on and federation features fetch metadata from configured URLs. Integrations with customer hosted systems connect to addresses customers choose. Each of these is a legitimate feature that becomes a vulnerability without controls on destination.
Indirect URL sources
URLs do not always arrive in an obvious field. They appear inside uploaded documents, in HTML that a renderer processes, in SVG images, in OpenAPI or feed documents an importer reads and in redirects returned by a first, harmless looking URL. An application that validates the URL a user typed but then follows redirects, or renders a document that references other URLs, can still be steered to internal addresses. Reviewers should trace every place the server opens a network connection, not just every form field labelled URL.
Protocols beyond HTTP
URL fetching libraries often support more than HTTP and HTTPS. File URLs read local files, and older libraries support schemes that can talk to mail servers, caches or other line based protocols. If an application passes a user URL straight to a library that supports these schemes, an attacker may read local files or send raw commands to internal services. Restricting allowed schemes to HTTPS, or HTTP and HTTPS, is a basic control that removes these paths.
Impact in practice
The impact of SSRF depends on what the server can reach. In a flat network with permissive cloud roles, it can lead to credential theft, data access across many storage buckets and full account compromise. In a segmented network with an egress proxy and scoped roles, the same bug may reach nothing of value. This is why SSRF severity is assessed against the environment, and why network and identity design are as important as application code in limiting it.
SSRF and microservices
Microservice architectures increase both the number of internal endpoints and the number of services that make outbound requests. Internal APIs often trust callers based on network location or a shared service header, assuming only other services can reach them. SSRF breaks that assumption. Requiring authenticated service identity on internal APIs, rather than trusting the network, limits what an SSRF in one service can do to others.
Recognising risky designs
During design review, any feature that asks the server to contact a destination chosen by a user should raise the SSRF question. Useful prompts are: who chooses the destination, which networks can the fetching component reach, what credentials does it hold, what does the user see of the response and can the destination change between validation and use. Answering these early is far cheaper than retrofitting controls after a finding.
Ownership of outbound requests
In many organisations, nobody owns the question of which services make outbound requests to arbitrary destinations. Each team adds a fetch for its own feature with its own validation. A useful step is an inventory of components that fetch user supplied URLs, with an owner for each and a requirement that they use a shared, reviewed fetching mechanism. This turns a scattered risk into a small number of controlled paths.
Reading the response
How much of the fetched response the attacker sees affects severity. A link preview that returns the page title shows a little, an import feature that stores the whole document shows everything and a webhook tester that displays the response body is effectively a full proxy. Reducing what is reflected, such as showing only a success flag or a parsed summary, limits information disclosure but does not remove the risk of actions triggered on internal services.
SSRF in serverless and containers
Serverless functions and containers have their own versions of the metadata problem. Function runtimes often expose credentials through environment variables or a local endpoint, and container platforms provide task or pod credential endpoints at fixed addresses. An SSRF that can read local files or reach these endpoints can obtain the same kind of temporary credentials. The same defences apply: minimal roles per function or task, blocking credential endpoints from components that do not need them and routing outbound fetches through controlled paths.
Severity scoring
When scoring an SSRF finding, consider three questions together: can the attacker choose any destination or only part of it, what does the fetching component reach and hold and how much of the response comes back. A full read SSRF from an unauthenticated feature on a component with a broad cloud role is critical. A blind SSRF limited to public addresses from a sandboxed worker may be low. Recording these factors makes scores consistent across teams.
SSRF turns a URL fetching feature into a proxy into the internal network and cloud metadata. It hides in webhooks, previews, importers, renderers and redirects, may be blind and is limited mostly by what the fetching component can reach and which credentials it holds.