Web App Security

What Is SSRF (Server-Side Request Forgery)? Definition, Architecture & Defense

Quick Definition: Server-Side Request Forgery (SSRF) is a web vulnerability where an attacker tricks a backend server into making HTTP or network requests to internal-only services, localhost ports, or cloud metadata endpoints.

How SSRF (Server-Side Request Forgery) Works in Practice

Features such as webhook testers, PDF generators, avatar URL fetchers, and link previewers take a URL from the user and fetch it from the server. If the server does not validate the destination IP, an attacker can supply http://169.254.169.254/latest/meta-data/ (cloud instance metadata) or http://127.0.0.1:6379/ to steal temporary IAM credentials or query internal databases behind the firewall.

Defensive Mitigation & Hardening Checklist

Enforce strict allowlists of permitted outbound domains, resolve DNS once and block RFC 1918 private IPs, loopback (127.0.0.0/8), and link-local metadata ranges (169.254.169.254), and enforce IMDSv2 hop-limit=1 on cloud instances.

Hands-On Tool & Cheat Sheet


Related Security Glossary Terms