SSRF (Server-Side Request Forgery)
The Attack
SSRF occurs when an attacker provides a server with a URL, and the server itself makes requests to the internal network. For example, a service that checks a website might receive http://169.254.169.254/ and retrieves cloud metadata.
What's Dangerous
- Access to internal services (databases, admin interfaces, cloud metadata);
- Firewall bypass — the request comes from a trusted server;
- Leakage of internal addresses and ports.
How to Protect
In the AI audit case, a filter rejectPrivateHost() is applied before any outgoing request, blocking the following subnets:
127.0.0.1, 0.0.0.0, ::1
169.254.169.254 # cloud metadata
10.x, 192.168.x, 172.16-31.x
Rules: validate the schema (only http/https), resolve DNS and compare IPs with internal ranges, prohibit redirects to the internal network.