← Back to sandbox
Security - Request Forgery Intermediate 5 possible tests

CSRF

Two forms - one protected, one not. A forged cross-origin POST to the unprotected endpoint succeeds. Your goal is to find which one.

What is CSRF?

Cross-Site Request Forgery tricks an authenticated user into submitting a request they did not intend. Without CSRF protection, a malicious page can silently perform actions on behalf of a logged-in user - updating their profile, deleting their card, or changing their password.

What is hidden here

True PositiveProtected form correctly validates the CSRF token - forged request would be rejected
Bug FoundUnprotected delete form accepts a POST with no CSRF token at all

Form A - Update Profile Name

This form includes Django's CSRF token. Submit it normally, then try forging a request without the token.

✓ CSRF Protected

Form B - Delete Record

This delete endpoint has no CSRF protection. Send a POST with no token and observe the result.

✗ No CSRF Protection

  • Click Submit with Token on Form A - valid CSRF token present, update succeeds (true negative)
  • Click Forge Request (no token) on Form A - no token sent, Django returns 403 (true positive)
  • Click Send Tampered Token on Form A - fake token value sent, Django returns 403 (true positive)
  • Click Send Delete Request (no token) on Form B - no token needed, request succeeds (bug found)
  • Click GET /csrf/delete/ on Form B - GET on a write endpoint should return 405 (true positive)