2.4
In progress
Forgery Attacks
Summary
Forgery attacks trick a trusted party into making requests the attacker wants. In cross-site request forgery, the victim's browser sends a request to a site where the victim is signed in. In server-side request forgery, a vulnerable server is made to send requests to internal systems.
Detailed explanation
-
Cross-site request forgery (CSRF): A malicious site causes the victim's browser to send an unwanted request to another site where the victim is authenticated, such as changing an email address.
- Confused deputy: A trusted party with authority is tricked into misusing it on someone else's behalf; CSRF is an example.
- Defenses: Anti-CSRF tokens, SameSite cookies, re-authentication for sensitive actions and checking request origin.
-
Server-side request forgery (SSRF): An attacker makes a server send requests to destinations of the attacker's choosing, often internal services or cloud metadata endpoints that aren't reachable from outside.
- Indicators: Server requests to internal addresses or metadata services that the application wouldn't normally contact.
- Defenses: Allow lists for outbound destinations, input validation of URLs, network segmentation and protected cloud metadata services.
Important terms
taken from the text above- Cross-site request forgery (CSRF)
- A malicious site causes the victim's browser to send an unwanted request to another site where the victim is authenticated, such as changing an email address.
- Confused deputy
- A trusted party with authority is tricked into misusing it on someone else's behalf; CSRF is an example.
- Server-side request forgery (SSRF)
- An attacker makes a server send requests to destinations of the attacker's choosing, often internal services or cloud metadata endpoints that aren't reachable from outside.
What I should remember
- CSRF: The victim's browser sends unwanted authenticated requests.
- SSRF: The server is tricked into requesting internal resources.
- Anti-CSRF token: Unique value proving a request came from the real site.
- Outbound allow list: Limits where a server can send requests.