Server-Side Request Forgery
What Is Server-Side Request Forgery?
Server-side request forgery, or SSRF, is a vulnerability that lets an attacker make an application server send a network request. Because it comes from the server, the request may reach internal systems or cloud resources a visitor's browser cannot access. MDN's SSRF guidance explains the risk of trusting server-originated requests.
How an SSRF Vulnerability Works
SSRF often appears in features that retrieve information from another location when the destination is not tightly controlled.
- A user supplies a URL or remote resource reference, such as for a preview or image import.
- The application creates an outbound API request to retrieve it.
- Weak validation permits an internal or redirected destination.
- The server sends the request using its own network access.
- The application may expose the response or perform an unintended action.
SSRF vs. CSRF: What Is the Difference?
SSRF and CSRF involve unwanted requests but target different systems. CSRF and XSRF are names for the same browser-based attack category.
| Aspect | SSRF | CSRF or XSRF |
|---|---|---|
| Request origin | Application server | Victim's browser |
| Primary target | Internal services or trusted network resources | A site where the victim is signed in |
| Common entry point | User-controlled URL or integration setting | A malicious page or link |
| Main defenses | Destination controls and network egress rules | Anti-CSRF tokens and cookie protections |
Why SSRF Can Be Dangerous
A vulnerable server can become a gateway into protected parts of an environment.
- It can expose internal administration tools or APIs.
- It may reach cloud metadata services that provide temporary credentials.
- It can trigger actions through services that trust the server.
- It may reveal network details or sensitive data.
Common SSRF Entry Points in Web Applications
Review any feature that makes an outbound connection, not only fields labelled “URL.”
- Link previews, feed readers, and webhook test tools.
- Document, image, or remote-file imports.
- PDF, screenshot, and media generation services.
- Third-party integrations and server-side API proxies.
How to Prevent Server-Side Request Forgery
Use layers of control rather than one input check.
- Prefer an allowlist of approved hosts and protocols.
- Parse URLs safely and recheck the final address after redirects.
- Block local and private ranges, and restrict outbound traffic with egress firewall rules.
- Use least-privilege identities and protect cloud metadata endpoints.
- Log outbound requests and review them through server monitoring dashboards.
Practical Limits of SSRF Defenses
Simple blocklists are not enough because destinations can change after an initial check.
- Hostname blocklists can miss alternate names and IP formats.
- DNS records can change between validation and connection.
- Redirects can send a safe-looking request elsewhere.
- Shared cloud infrastructure can complicate address-based rules.
- Test controls in development and production networks.
Building Integrations Safely with Emergent
Apps built with Emergent can connect APIs, webhooks, remote files, and third-party services. When using an AI web app builder, specify approved services, authentication boundaries, redirect rules, and outbound-request restrictions during implementation. This makes SSRF-aware design part of the integration plan.
on Emergent today

