SSRF
Definition
Server-Side Request Forgery (SSRF) is a security vulnerability that allows an attacker to induce a server-side application to make HTTP requests to an arbitrary domain of the attacker’s choosing. This can lead to unauthorized access to internal systems, data exposure, or even remote code execution if the server processes the response in an unsafe manner. SSRF exploits typically occur when an application accepts untrusted input to construct a request without proper validation or sanitization.
Secure Settings Example
# Example of a secure configuration in a web application firewall (WAF) to prevent SSRF
rules:
- id: "1001"
description: "Block SSRF attempts"
action: "deny"
conditions:
- type: "request"
field: "url"
match: "regex"
pattern: "^(http|https)://(localhost|127\\.0\\.0\\.1|internal-service|169\\.254\\.169\\.254)"
Insecure Settings Example
# Example of an insecure configuration allowing SSRF
proxy:
enabled: true
allowed_hosts:
- "*"
# This configuration allows requests to any host, including internal services