# Server-Side Request Forgery (SSRF)

> Making a server fetch a link of the attacker's choice. Often it is a private one.

**Field:** Software Development  
**Category:** Security  
**Also known as:** SSRF, SSRF Attack

## Think of it like

Think of it like a guard who fetches things from rooms you cannot go in.

## Definition

SSRF tricks a server into making a web request for the attacker. The app fetches a link the user gives, say to show a preview. The attacker gives a link to an inside address instead. The server can reach places the attacker cannot, like private admin pages or cloud settings. So the reply leaks secrets. The fix is to fetch only from a fixed list of places.

## Example

An app makes a preview of any link. An attacker pastes a private address from inside the company, and the preview shows an admin page.

## Why it matters

Cloud servers can often reach secret keys through inside addresses. SSRF can hand those keys to a stranger.

## Common mistake

Blocking a few bad addresses by name. Attackers find other ways to write them, so allow only safe places you know.

## Three principles

- **The server fetches.** The attacker borrows its reach.
- **Inside addresses.** Private pages become reachable.
- **An allow list.** Fetch only from known places.

## Related terms

- [Broken Access Control](https://learn.benibix.com/term/development/broken-access-control)
- [OWASP Top 10](https://learn.benibix.com/term/development/owasp-top-10)
- [Input Validation](https://learn.benibix.com/term/development/input-validation)
- [Cross-Site Request Forgery (CSRF)](https://learn.benibix.com/term/development/cross-site-request-forgery)
- [Firewall](https://learn.benibix.com/term/infrastructure/firewall)

## Told apart from

- [SSRF vs CSRF](https://learn.benibix.com/compare/ssrf-vs-csrf): People think SSRF and CSRF are the same trick because the names sound alike, and they are not. In CSRF, the attacker gets your browser to send a request to a site you are logged in to. In SSRF, the attacker gets the server itself to send the request. Often it goes to a private address inside the server's own network.

![A table of four attacks, with what the attacker sends and what goes wrong. SSRF sends preview?url=http://10.0.0.5/admin, and the server fetches its own private page. Path traversal sends view?file=../../../etc/passwd, and a server file is sent back. Broken access control asks for /orders/1042, not his own, and a stranger's order is shown. Remote code execution, lit up, sends a booby-trapped upload or request, and the attacker's code runs on the server.](https://learn.benibix.com/diagrams/dev2-server-attacks.svg)

---

Source: https://learn.benibix.com/term/development/server-side-request-forgery
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
