Skip to content
IT glossary
SecurityUpdated December 3, 2026

Server-side request forgery

SSRF

A vulnerability that lets a user make a server send a request to a destination the application should not contact. The request may reach a service the user cannot access directly.

What server-side request forgery means

Server-side request forgery (SSRF) is a flaw in how an application chooses where to send an outbound request. User-controlled data influences the destination, and the application fails to enforce which destinations the feature is allowed to contact. The request originates on the server's network. An internal API that is unreachable from a user's browser may still be reachable from the backend.

Where it shows up

Link previews, remote file imports, image fetchers, and webhook delivery all make outbound requests as part of their normal operation. A full URL in an API field is one place to look during code review, but user input can also influence just one part of the destination, such as the host or port. The question is whether a user can cause the feature to reach somewhere outside its intended scope.

Sometimes the application gives the caller the content it fetched. That can expose data from a service the caller could not otherwise read. In blind SSRF, the fetched content is not returned to the caller. An outbound request can still trigger work on another service, and differences in errors or response times can reveal information even without a response body.

Example: importing from known partners

Suppose an inventory app imports catalogs from three partners. The API can accept a partner ID rather than a URL. After checking that the caller is allowed to run the import, the backend looks up the destination in server-managed configuration. It does not follow redirects automatically. The caller gets to choose a partner, not the network address the import worker connects to.

How to prevent it

  • Use a fixed set of destinations when possible. If you must accept URLs for known services, parse them and match the scheme, hostname, and port against an explicit policy. A string-prefix check is not a destination policy, and HTTPS does not make a destination authorized.
  • Enforce the policy at connection time. When a feature must fetch arbitrary public URLs, ensure it connects only to an IP address that the policy permits, not merely to a hostname that passed an earlier check. Disable redirects unless the feature needs them. If redirects are allowed, apply the same policy to every hop.
  • Limit the fetcher's network access. Put outbound controls on the worker or its proxy so an application bug does not automatically give the fetcher access to internal services or cloud metadata. Do not forward the caller's cookies or authorization headers to fetched destinations.

How it comes up in interviews

A common prompt is to design a link-preview service. Start by asking whether it needs to fetch any public URL or only URLs from known sites. That requirement determines whether a fixed destination list is practical or whether the design needs a dedicated fetcher with tightly restricted outbound access. If asked whether CORS helps, identify who makes the request: CORS governs cross-origin access in browsers, not outbound requests made by backend services.