Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a page on CSRF #38151

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Add a page on CSRF #38151

wants to merge 6 commits into from

Conversation

wbamberg
Copy link
Collaborator

@wbamberg wbamberg commented Feb 14, 2025

This PR adds a page on CSRF attacks.

It's potentially a replacement for https://developer.mozilla.org/en-US/docs/Web/Security/Practical_implementation_guides/CSRF_prevention, and compared with that page:

  • explains in more concrete terms what a CSRF attack is and how it works
  • describes an alternative defense
  • describes in a bit more detail about the limitations of SameSite

I wonder if it's worth mentioning somewhere that CSRF is a sort of "write-only" attack: the attacker doesn't get access to the response, and doesn't care about it. So a lot of same-origin policy, which is to do with read access (MDN's own page on SOP says "Cross-origin writes are typically allowed."), isn't applicable.

@github-actions github-actions bot added Content:Security Security docs size/m [PR only] 51-500 LoC changed labels Feb 14, 2025
Copy link
Contributor

github-actions bot commented Feb 14, 2025

Preview URLs

External URLs (5)

URL: /en-US/docs/Web/Security/Attacks/CSRF
Title: Cross-site request forgery (CSRF)

(comment last updated: 2025-02-14 21:06:42)

@wbamberg wbamberg marked this pull request as ready for review February 14, 2025 19:28
@wbamberg wbamberg requested a review from a team as a code owner February 14, 2025 19:28
@wbamberg wbamberg requested review from hamishwillee and chrisdavidmills and removed request for a team February 14, 2025 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:Security Security docs size/m [PR only] 51-500 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant