# Cross-Site Request Forgery (CSRF)

> Master CSRF exploitation and defense. Learn to forge state-changing requests, bypass anti-CSRF tokens, and exploit SameSite cookie misconfigurations.

Canonical: https://codelivly.com/rooms/cross-site-request-forgery-csrf
Last updated: 2026-11-29

| | |
|---|---|
| Level | Intermediate |
| Category | Web Security |
| Lessons | 6 |
| Estimated time | 3 h |
| XP | 1150 |

This module dives deep into Cross-Site Request Forgery (CSRF), a critical vulnerability that forces an authenticated user to execute unwanted actions on a web application. You will learn to identify state-changing endpoints, craft malicious forged requests, and bypass common defenses like anti-CSRF tokens, Referer/Origin header checks, and SameSite cookie attributes. The module culminates in a hands-on guided lab where you will exploit a complex CSRF vulnerability to achieve administrative account takeover safely and professionally.

## Lessons

1. What Is CSRF & Why It Matters (30 min)
2. Building a Basic CSRF Proof of Concept (30 min)
3. Bypassing Weak Token Checks (30 min)
4. SameSite Cookies and Their Gaps (30 min)
5. Defender's View: Tokens, SameSite, and Origin Checks (30 min)
6. Guided Lab: Change a Lab Account Email via CSRF (30 min)

## Related

- [Learning path: Client-Side Vulnerability Hunting](https://codelivly.com/learning-paths/client-side-vulnerability-hunting)
- [All rooms](https://codelivly.com/rooms)
