Server-Side Request Forgery (SSRF)
: A vulnerability that allows an attacker to make the server-side application send HTTP requests to an arbitrary destination chosen by the attacker. This can expose internal services, cloud metadata endpoints, and private network resources that are not directly accessible from the internet.
Why It Matters for AI-Coded Apps
AI-generated apps often include URL-fetching features (link previews, webhook handlers, file imports from URLs) without validating the target. Cloud environments are especially vulnerable because the metadata endpoint (169.254.169.254) can expose credentials, API keys, and infrastructure details.
Real-World Example
An app has a feature to fetch a URL preview: fetch(userProvidedUrl). An attacker submits http://169.254.169.254/latest/meta-data/iam/security-credentials/ to read AWS IAM credentials from the metadata service, gaining access to the cloud infrastructure.
How to Detect and Prevent It
Validate and allowlist destination URLs. Block requests to private IP ranges (10.x, 172.16-31.x, 192.168.x, 169.254.x). Use a URL parser to resolve the hostname before making the request (prevent DNS rebinding). Run URL-fetching services in isolated network segments without access to internal resources.
Frequently Asked Questions
Why is SSRF dangerous in cloud environments?
Cloud providers expose metadata services at 169.254.169.254 that return sensitive information including temporary credentials, API keys, and infrastructure configuration. SSRF allows attackers to query these endpoints through your application, potentially compromising the entire cloud account.
How does DNS rebinding bypass SSRF protections?
DNS rebinding exploits the gap between URL validation and request execution. The attacker’s domain first resolves to a public IP (passing validation) then switches to a private IP (like 169.254.169.254) before the actual request. To prevent this, resolve DNS once and use the resolved IP for both validation and the request.
What is blind SSRF?
Blind SSRF occurs when the server makes the request but doesn’t return the response to the attacker. The attacker can still use it for port scanning, accessing internal services, or triggering actions. Detection requires monitoring outbound requests from your servers.
Scan your app for security issues automatically
Vibe Eval checks for 200+ vulnerabilities in AI-generated code.
Try Vibe Eval