Server-Side Request Forgery (SSRF)
What You'll Learn
You'll learn how attackers manipulate servers into making unintended requests to internal or external systems, bypassing network security boundaries.
The Core Concept
Server-Side Request Forgery (SSRF) occurs when an attacker tricks a web server into making HTTP requests on their behalf. Instead of attacking the server directly, the attacker uses the server as a proxy to access resources that would normally be protected or inaccessible.
Think of it like this: imagine a trusted employee (the server) who can access restricted areas of a building. An outsider (the attacker) convinces this employee to fetch documents from secure rooms by giving them seemingly legitimate requests. The employee unknowingly becomes the attacker's accomplice.
How SSRF Works
SSRF typically exploits features where servers fetch external resources—like URL preview generators, image processors, or webhook handlers. The attacker supplies a malicious URL that targets:
- Internal systems:
http://localhost:8080/adminorhttp://192.168.1.5/database - Cloud metadata services:
http://169.254.169.254/latest/meta-data/(AWS credentials) - Internal network resources: Services hidden behind firewalls
Because the request originates from the trusted server itself, internal systems often accept it without question—bypassing firewall rules and authentication checks designed to block external attackers.
Real-World Impact
SSRF can enable attackers to:
- Read sensitive internal files and configurations
- Access cloud provider metadata containing credentials
- Port-scan internal networks
- Execute commands on internal services
- Pivot to other attacks like Remote Code Execution
Key Takeaway: SSRF exploits the trust relationship between a server and its internal network, turning the server into an unwitting intermediary that performs requests the attacker couldn't make directly—making input validation and URL filtering critical security controls.