Skip to content
Learn Netverks

Lesson

Step 15/36 42% through track

csrf-preview

CSRF (Preview)

Last reviewed Jun 1, 2026 Content v20260601
Track mode
none
Means
Read / quiz
Reading
~1 min
Level
intermediate

This lesson

This lesson teaches CSRF (Preview): security mindset, common threats, and defensive practices for software teams.

Web flaws ship weekly—OWASP categories turn code review into repeatable habit.

You will apply CSRF (Preview) in contexts like: Web apps, APIs, CI/CD, and organizational compliance programs.

Read scenario-based lessons, map controls to code you write on other tracks, and complete MCQs—practice threat modeling on paper or in docs.

When you can explain the previous lesson's ideas in your own words.

Cross-Site Request Forgery tricks a logged-in user's browser into submitting unwanted requests to your site.

Example

Malicious page: <img src="https://bank.com/transfer?to=attacker&amount=1000"> if cookies send automatically.

Defenses

  • CSRF tokens tied to session
  • SameSite cookies
  • Require re-auth for sensitive actions

Important interview questions and answers

  1. Q: CSRF vs XSS?
    A: XSS runs script; CSRF abuses existing session from another site.
  2. Q: SameSite=Strict?
    A: Cookie not sent on cross-site requests.

Self-check

  1. What does CSRF exploit?
  2. Name two defenses.

Tip: Framework CSRF middleware ON—do not disable without replacement.

Interview prep

CSRF token?

Secret form value attacker cannot guess cross-site.

Interview tip Lesson completion confidence

Can you explain this lesson in 30 seconds without reading notes?

Not saved yet.

Check yourself

Multiple choice — immediate feedback.

Discussion

Past discussion is visible to everyone. Only logged-in users can post comments and replies.

Starter discussion topics

  • CSRF vs XSS?
  • SameSite help?

Sign up or log in to post comments and sync lesson progress across devices.

No discussion yet. Be the first to ask a question.

Jump