Skip to content

Bug class · Intermediate

Server-side request forgery (SSRF)

The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.

median public bounty
$2,000

Covers CWE 918.

How it works

Full lesson

The pattern behind every report in this class.

Server-side request forgery (SSRF) is a vulnerability where an attacker can make a server-side application send a request to a destination of the attacker's choosing. This is dangerous because the server often has access to internal networks, cloud metadata services, and other resources that are not reachable from the internet. Bug bounty programs care about SSRF because it can lead to data exposure, internal network scanning, and in some cases remote code execution. The evidence shows that SSRF is a common finding across many reports, with 522 reports in the dataset and 122 paid, indicating that it is a valuable and frequently rewarded vulnerability class.

SSRF typically leads to access to cloud metadata endpoints, which can expose sensitive instance credentials and configuration. It can also be used to scan internal ports, read internal files, and interact with internal services such as Redis or SMTP. In some cases, SSRF can be chained with other vulnerabilities to escalate impact, for example by combining it with an open redirect or a file upload to achieve code execution. The evidence includes reports where SSRF was used to reach AWS metadata, read local files, and scan internal networks.

SSRF is most often found in features that fetch remote resources: PDF generators, headless browsers, webhook creation and testing, link preview and unfurling, image import from URL, repository and content importers, and third-party integrations. It also appears in less obvious places such as analytics dashboards, meme creation features, and avatar upload by URL. The evidence shows a wide range of affected features, from cloud metadata endpoints to PDF generators and webhook handlers.

SSRF works by exploiting a feature that takes a user-supplied URL and makes a server-side request to it. The attacker provides a URL pointing to an internal or otherwise restricted resource, and the server fetches it, potentially returning the response or using it in a way that leaks information. The root cause is often a failure to validate the destination after DNS resolution, or a validation that can be bypassed through redirects, alternative IP representations, or parser inconsistencies.

Things to try

All 306

Each line worked in a disclosed report. Test only what a program's scope allows.

Other 75

  • Upload a file and intercept the request to the original image path, then add an X-Forwarded-Host header with an arbitrary domain and observe the response.
  • Supply an unsanitised IPFS content identifier and see whether it can direct requests against the configured gateway.
  • Inject an image tag into a career form field and watch for a blind server-side request.
  • On a login page that uses a fetch API, point the fetch at an attacker-controlled server and see if the victim's IP is exposed.

Webhooks and integrations 20

  • Set the Phabricator integration URL to an internal address and submit to make the backend fetch it.
  • Configure a webhook to an internal address and trigger an event to make the server request it.
  • Abuse a resolver bug in the language runtime to make an integrations feature perform blind SSRF.
  • Look for a blind SSRF in a GitHub-related feature and confirm it via out-of-band requests.

URL parser and validation bypasses 17

  • Pass the allowed domain as an extra query parameter so a substring check passes while the real target differs.
  • Supply a URL with an embedded @ to an audio endpoint and see whether the server fetches the host after the @ and returns its content.
  • Exploit a regex used for URL validation so a dot matches unintended characters and leads to SSRF.
  • Put a hash character in the password portion of a URL so the parser and fetcher disagree about the host.

Repository import and mirroring 16

  • In the mirroring repositories feature, use the Detect host keys function with an SSH URL pointing to localhost to see if the server connects.
  • In a new project page, select 'Repo by URL' and enter a URL pointing to an address in the shared address space to see if the server connects.
  • Use the project import feature with a repository URL pointing at an internal host.
  • Enter a localhost URL in the FogBugz import form, start a listener and continue to observe the POST arriving.

PDF generation and rendering 15

  • Bypass an HTML filter in a packing slip template to reach internal Kubernetes endpoints.
  • Point a PDF renderer's external references at internal files and escalate to local file read and remote code execution.
  • Use a spreadsheet file conversion feature to trigger local file disclosure and SSRF.
  • Point a PDF generator's external references at an internal host.

Bypasses and variations

All 20
  • Bypass SSRF filters with redirects, IPv6-mapped addresses, NAT64 prefixes, percent-encoded IPv4 or DNS rebinding.
  • Bypass internal SSRF protection on slash commands by redirecting to an internal address.
  • Use DNS rebinding to bypass an SSRF filter and reach an internal host.
  • Bypass an SSRF blacklist by using the IPv6 unspecified address as the hostname to reach loopback services.
  • Bypass an IP blacklist on callback URLs with DNS rebinding so the second resolution lands on a private address.
  • Use a redirect from an attacker-controlled file to switch the fetch to gopher or ftp.

Typical fixes

  • Validate the resolved destination against an allowlist and block private, link-local and metadata addresses after DNS resolution

Tips for beginners

All 14
  • Start by looking for features that make outbound requests: URL imports, webhook configurations, link previews, PDF generation, image fetch from URL, and integrations. Use a listener you control to confirm blind SSRF. The evidence shows many reports where hunters confirmed SSRF with a listener.
  • Test for cloud metadata access by pointing the feature at the metadata endpoint. If you can read instance data, that is a strong impact. The evidence includes multiple reports where SSRF reached cloud metadata.
  • Try to bypass filters using common techniques: redirects, IPv6-mapped addresses, NAT64 prefixes, percent-encoded IPv4, DNS rebinding, and parser differentials. The evidence shows these bypasses were successful in many reports.
  • Check for redirect handling: if the application follows redirects, try redirecting to an internal address. Also test for protocol switching, such as redirecting to gopher or file. The evidence includes reports where redirects were used to bypass protections.
  • Look for URL validation that is done on the raw string rather than the parsed host, or that uses substring matching. Try adding the allowed domain as a query parameter or using a hostname that starts with the allowed domain. The evidence shows these bypasses.
  • Test less obvious features: meme creation, avatar upload by URL, analytics dashboards, and third-party integrations. The evidence includes SSRF in these areas.

Start here: a reading path

Open the path

Clear reports in order, easiest first.

Guides and techniques

View all

The best explainers, cheat sheets and technique posts on SSRF, from around the web.

Newest reports

All 1,203

Most recently disclosed.

New SSRF reports by email

Follow SSRF and get each week's new disclosures in one short email.

Free. New reports for what you follow, weekly by default. One-click unsubscribe. Privacy