Web SecurityWeb Security · Lesson 08

CSRF, SSRF & Open Redirect

Forged requests, server-side request forgery and unsafe redirects.

Video tutorialTrack course · freeCodeCamp
Speed
Next lesson
Watch 00:00 · 2 checkpoints Watch on YouTube More on this topic
Transcript & captions
5/5

CSRF tricks a logged-in victim's browser into sending a state-changing request. SSRF tricks the server into making a request on the attacker's behalf - often to internal services the attacker cannot reach.

BugDefence
CSRFSameSite cookies, anti-CSRF tokens, re-auth on sensitive actions
SSRFAllowlist destinations, block private IP ranges and metadata endpoints
Open redirectOnly redirect to relative paths or an allowlist
Clickjackingframe-ancestors 'none' or X-Frame-Options DENY

SSRF against cloud metadata services can expose instance credentials - treat any user-supplied URL that the server fetches as high risk.

Knowledge check

0/2 answered

SameSite cookies primarily mitigate...

SSRF means the request is made by...