← Back to Attack / Defense Lab
OSI LAYER 7 // Application Layer

Cross-Site Request Forgery (CSRF)

CSRF tricks an authenticated browser into sending an unwanted state-changing request to a site where the victim is already signed in.

01 // HOW IT WORKS

Mechanism

The browser automatically supplies authentication material such as cookies while the application fails to verify that the request originated from an intended interaction.

02 // DETECTION

Indicators to watch

Unexpected state changes, requests lacking valid CSRF tokens, unusual Origin/Referer values, and state-changing endpoints that accept cross-site requests are useful signals.

03 // ATTACK FLOW

Concept diagram

01Authenticated browser↓
02Cross-site request↓
03State-changing endpoint↓
04Unwanted action↓
05CSRF token + SameSite
04 // PREVENTION

Defensive controls

Use anti-CSRF tokens, SameSite cookies, Origin/Referer validation where appropriate, re-authentication for sensitive actions, and avoid unsafe state changes through GET.

05 // SECURITY TOOL

Recommended security control

CSRF middleware + SameSite cookies

Validate defenses in an application test environment.

06 // DEFENCE PRACTICE LAB

Defence practice lab

The administrator has not attached a tool link yet. This slot will show “Build Soon” until an external link is configured.

Build Soon
◈
DEFENCE PRACTICE LAB // BUILD SOONThe administrator can add or edit an external defence practice lab link from the private admin portal.
07 // DEFENCE TECHNIQUES

Defence techniques

Defence techniques for this attack will be added by the administrator.

AUTHORIZED LEARNING

All attack descriptions are for defensive education. Test scanning, traffic generation, interception, wireless testing, and vulnerable applications only on systems and networks you own or are explicitly authorized to assess.