What Is Server-Side Request Forgery (SSRF)?
Written By
Sarwat Iftikhar
Server-side request forgery (SSRF) is a class of web application vulnerability in which an attacker manipulates an application into sending HTTP requests to a destination of the attacker’s choosing rather than the intended one. The application acts as a proxy: it makes the request using its own network identity, its own access to internal infrastructure, and in cloud environments, its own access to the credentials and configuration data exposed by the cloud provider’s metadata service. The attacker benefits from all of that without needing direct access to any of it, because the request arrives at the internal destination from a trusted source rather than from the attacker’s external IP address.
SSRF appears consistently in industry vulnerability classifications and has been exploited in some of the most significant data breach disclosures of recent years, with cloud-hosted applications being the highest-impact targets. Any application feature that accepts a URL, fetches a remote resource, generates content from a web address, or processes user-supplied endpoints is a potential SSRF entry point, and the range of features that fit this description is broader than most development teams recognize at design time.
Key Takeaways
- SSRF forces a server to make HTTP requests to attacker-controlled destinations, reaching internal infrastructure the attacker cannot access directly because the request appears to originate from a trusted internal system
- The impact ranges from internal network reconnaissance to credential theft from cloud provider metadata endpoints, depending on what the application server can reach from its network position
- Blind SSRF produces no visible response but still executes the request; it is detected through out-of-band interaction techniques and is as exploitable as basic SSRF despite being harder to identify during initial testing
- Any application feature that fetches URLs, generates PDFs or screenshots from web pages, processes webhooks, imports remote files, or resolves links to preview content is a potential SSRF entry point regardless of how the feature is described to users
- Remediation requires allowlist-based destination validation at the code level combined with network controls that restrict what internal addresses the application server can reach
How Does SSRF Work?
SSRF exploits the trust relationship between a web application’s server and the internal resources that server can reach. When an application accepts a URL as input and makes an HTTP request to that URL server-side, an attacker who can control the URL can direct the request to any destination accessible from the server’s network position. The URL the server fetches does not need to be on the public internet. It can be an internal IP address, a loopback address, a link-local address used by cloud providers for metadata services, or any host the server can reach that the attacker cannot.
Basic SSRF produces a response that the application returns to the attacker, either directly or embedded in the application’s output. An application that fetches a URL and displays the returned content in its interface gives the attacker direct read access to whatever the server retrieved. If the fetched address is an internal service that exposes administrative functionality, database contents, or configuration data, that information is returned to the attacker through the application’s own interface.
Blind SSRF produces no visible response in the application’s output. The server makes the request, but the attacker cannot read the result directly. Blind SSRF is detected through out-of-band interaction: the attacker supplies a URL pointing to an endpoint under their control or to a purpose-built testing service they monitor, then confirms the request was made by observing the interaction log. Even without a readable response, blind SSRF enables internal network scanning by timing responses and observing error codes, confirms which hosts and ports are reachable from the server, and can trigger callbacks to attacker-controlled infrastructure that chain into further exploitation.
SSRF through redirects occurs when an application validates the initially supplied URL against an allowlist but follows HTTP redirects without re-validating the destination after each hop. An attacker who controls a domain on the allowlist can serve a redirect to an internal address. The application’s validation passes on the initial URL and then blindly follows the redirect to the internal target, bypassing the restriction entirely.
Web application security covers SSRF as part of the broader vulnerability class alongside injection, authentication, and access control issues that frequently co-occur with SSRF in the same application. API security testing is directly relevant to SSRF because APIs are the most common modern entry point for the vulnerability: endpoints that accept URL parameters, process webhook registrations, or make outbound calls based on user-supplied configuration are SSRF candidates that are frequently less scrutinized than browser-facing features.
What Internal Resources Does SSRF Target?
SSRF testing maps the internal resources accessible from the application server’s network position, which determines the actual business impact of a confirmed vulnerability.
Cloud provider metadata endpoints are the highest-impact SSRF target in cloud-hosted applications. Cloud providers expose a metadata API at a link-local IP address (169.254.169.254 is the most widely implemented endpoint) that returns configuration data and temporary credentials attached to the instance’s service account or IAM role. An application running on a cloud host that is vulnerable to SSRF can be used to fetch the metadata endpoint, retrieve short-lived credentials, and use those credentials to access cloud resources outside the application’s intended scope. The range of access depends on what permissions are attached to the instance’s role, which in environments where IAM permissions have not been minimized can reach storage, secrets management services, internal databases, and administrative APIs.
Internal network services are reachable when the SSRF request is directed at internal IP address ranges. Services running on the internal network that do not enforce authentication because they are not expected to receive external requests, including administrative dashboards, internal APIs, CI/CD platforms, and databases that accept HTTP connections, become accessible from the application server’s network position. Internal port scanning through SSRF maps which services are running on which internal hosts by observing response timing and error messages, providing the attacker with a network map they could not build from an external position.
Non-HTTP protocol handlers expand the attack surface when the application’s URL-fetching component supports schemes beyond HTTP and HTTPS. The file:// scheme reads files from the server’s local filesystem. The gopher:// scheme constructs arbitrary TCP payloads and can interact with services that do not speak HTTP. The dict:// scheme retrieves information from dictionary servers. Each additional scheme supported by the HTTP client extends the range of exploitation beyond web-accessible resources.
Cloud security in the context of SSRF centers on how cloud-specific infrastructure exposure amplifies what would otherwise be a contained web application vulnerability into a path that reaches cloud-wide resources through the metadata endpoint. Cloud security assessment evaluates whether SSRF vulnerabilities in cloud-hosted applications can reach the metadata endpoint and what access the returned credentials provide, making SSRF testing a core component of any cloud application security engagement.
Which Application Features and Techniques Are Most Commonly Exploited?
SSRF entry points appear across a wide range of application features, most of which are not recognized as security-sensitive by the development teams that build them.
Webhook registration features that accept a URL to call when an event occurs are among the most commonly exploited SSRF entry points in modern applications. When an application accepts a webhook URL from a user and makes an HTTP request to that URL to deliver event data or verify the endpoint, an attacker can supply an internal URL as the webhook destination. The application calls the internal address to deliver the event payload, and the response from the internal service is returned to the attacker through the webhook delivery mechanism. Webhook SSRF is particularly prevalent in SaaS platforms and integration-heavy applications where webhook registration is a core product feature.
URL fetch and content import features include PDF generation from web addresses, link preview generation, image URL import, metadata fetching from remote pages, and similar features where the application retrieves content from a URL the user supplies. These features are designed for external URLs but rarely enforce restrictions on what addresses they will reach. A PDF generator that fetches a URL to render it will fetch an internal URL with equal readiness, and the generated PDF returns whatever content the internal address provided, including internal configuration pages, administrative interfaces, or cloud metadata.
GraphQL resolvers that make outbound HTTP requests based on user-supplied arguments represent a growing SSRF surface in modern API-driven applications. When a resolver accepts a URL argument and fetches content from it to populate a response field, the resolver can be targeted with internal URLs. GraphQL security testing covers the full class of injection and abuse techniques that resolver arguments expose, of which SSRF is a category when resolvers make outbound requests based on user-controlled input.
Allowlist bypass techniques are used when an application implements destination restrictions but validates the URL incorrectly. URL parsing inconsistencies allow an attacker to supply addresses that bypass simple string-matching checks while resolving to restricted destinations. Open redirects on allowlisted domains serve as bypass vectors by supplying a URL to an allowlisted domain that redirects to an internal target after the destination check passes. Alternative IP representations, including decimal encoding, hexadecimal encoding, and IPv6-mapped IPv4 addresses, exploit parsing edge cases in validation code that checks the hostname string rather than resolving the address before comparing it. DNS rebinding attacks pass validation with an external address that subsequently resolves to an internal one after the check completes.
SSRF vulnerabilities are introduced at the code level by developers who implement URL-fetching logic without applying destination validation, and the fix is at the same layer. Secure code review that covers HTTP client usage, URL construction, and input validation at the code level identifies SSRF vulnerabilities at the point where they can be remediated most efficiently, before they reach production environments where exploitation risk is real.
How Is SSRF Tested and Prevented?
Testing for SSRF involves injecting test URLs into every application parameter that may be processed server-side: webhook URL fields, URL import parameters, link preview inputs, file import endpoints, and API parameters that accept addresses or references to external resources. The initial test URL points to an out-of-band interaction endpoint that the tester controls, so that blind SSRF is detected even when no response is returned through the application. Any interaction received at the out-of-band endpoint confirms the application is making server-side requests to the supplied URL.
Confirmed SSRF findings are then escalated by targeting internal addresses on private IP ranges, protocol handlers beyond HTTP and HTTPS, and, in cloud environments, the metadata endpoint at 169.254.169.254. The escalation phase determines the actual impact of the vulnerability by confirming what internal resources the application server can reach and what data or access each reachable resource exposes.
A complete SSRF assessment covers every application feature where the server makes outbound requests based on user input, not only the features labeled as URL fields in the interface. Features that accept text strings and process them as links, features that import content by reference, and APIs that trigger outbound events all require SSRF testing.
Remediation requires both code-level validation and network-layer restriction. At the code level, the fix is strict allowlist validation of the destination URL before the request is made: the application resolves the hostname of the user-supplied URL and checks the resolved IP address against a list of permitted external destinations, rejecting requests where the resolved address falls in private, loopback, link-local, or other restricted ranges. Blocklist-based approaches that attempt to enumerate forbidden addresses are insufficient because bypass techniques reliably defeat them; only allowlist-based validation that checks the resolved IP provides reliable protection.
At the network level, outbound requests from the application server should be restricted to the external hosts the application legitimately needs to contact, using firewall rules or security group configuration. Even if a code-level allowlist is bypassed through a redirect chain or parsing edge case, a network-layer restriction that prevents the application server from reaching internal addresses stops exploitation.
Bugstrix cybersecurity code review identifies SSRF vulnerabilities at the source code level by reviewing HTTP client implementations, URL handling logic, and input validation coverage before the application is deployed. Bugstrix web application penetration testing services test for SSRF across all application entry points through active exploitation in the target environment, confirming which findings are reachable from an attacker’s position and what access each one provides.
Get a free quote for a web application penetration test or secure code review engagement
Frequently Asked Questions
What is the difference between SSRF and CSRF?
Cross-site request forgery (CSRF) forces a victim’s browser to send a request using the victim’s authenticated session, with the victim as the target. SSRF forces the server itself to send a request using the server’s network identity, with internal infrastructure as the target. CSRF exploits the trust a web application has in a user’s browser session. SSRF exploits the trust that internal services extend to requests originating from the application server’s IP address. The two vulnerabilities involve different attack models, different victims, and different remediation approaches, though both involve forging requests that appear to come from a trusted source.
What makes cloud environments the highest-impact SSRF targets?
Cloud providers expose a metadata API at a well-known link-local IP address that returns the configuration and temporary credentials attached to the cloud instance’s service account or IAM role. Any application running on a cloud host that is vulnerable to SSRF can be used to retrieve those credentials through the metadata endpoint. The credentials are scoped to whatever permissions are attached to the instance’s role, and in environments where those permissions have not been minimized they provide access to storage, secrets managers, internal databases, and other cloud services. The metadata endpoint is reachable from every cloud instance by default, making cloud SSRF exploitable without any additional prerequisite beyond the initial web application vulnerability.
How is blind SSRF detected if no response is returned to the attacker?
Blind SSRF is detected through out-of-band interaction. The tester supplies a URL pointing to an endpoint under their control or to a purpose-built testing service that logs incoming HTTP requests. If the application makes the request, the testing endpoint receives it and logs the interaction with a timestamp, the requesting IP address, and the HTTP headers the application sent. The requesting IP address confirms the request came from the application server rather than from the tester’s own machine, confirming SSRF even when the application returns nothing from the internal fetch. Once blind SSRF is confirmed, internal network scanning proceeds by observing response timing and connection behavior rather than response content.
Can SSRF occur in APIs that do not display responses to users?
Yes. SSRF in APIs that do not return the fetched content directly is blind SSRF, and it is as exploitable as basic SSRF using out-of-band detection techniques. Even without a visible response, blind SSRF in an API can be used to map internal network hosts and ports, to trigger callbacks that chain into other vulnerabilities, and in cloud environments to retrieve metadata credentials through a callback that sends the credential data to attacker-controlled infrastructure. The absence of a visible response does not limit the exploitability of SSRF; it only changes the technique required to detect and demonstrate it.
What is the most reliable way to prevent SSRF?
The most reliable SSRF prevention is strict allowlist-based validation that resolves the destination hostname to its IP address before making the request and rejects the request if the resolved IP falls in any private, loopback, link-local, or cloud-metadata address range. This check must occur after all redirects are resolved, not only on the initially supplied URL, to prevent bypass through open redirects. Network-level controls that restrict outbound connections from the application server to only the external hosts the application legitimately needs to contact provide a second layer of defense. Disabling support for non-HTTP URL schemes (file://, gopher://, dict://) in the HTTP client removes the protocol handler exploitation category. In cloud environments, requiring the specific request header that the metadata service’s newer authentication mode enforces eliminates the most critical SSRF impact even if a URL validation bypass is found.
SSRF Reaches What Attackers Cannot Reach by Any Other Route
The characteristic that makes SSRF consistently high-impact is not technical complexity; it is position. The application server occupies a network position that the attacker does not: it can reach internal services, cloud metadata endpoints, and backend APIs that reject connections from external IP addresses without a second thought. SSRF hands the attacker the server’s position without the attacker needing to compromise the server itself. The request comes from a trusted source, so internal services respond as if the request is legitimate, because from their perspective it is.
Bugstrix SSRF testing covers every application entry point where server-side HTTP requests can be influenced by user input, from webhook parameters and URL import fields to API endpoints and GraphQL resolvers. The goal is not a list of parameters that accept URLs but a confirmed demonstration of what each reachable internal resource provides to an attacker who controls the destination. Remediation decisions built on that demonstration are targeted at the specific validation gaps and network positions that make each finding exploitable.
Contact us to discuss a web application security assessment or SSRF-focused code review