[Research] Modern CSRF protection via Sec-Fetch-Site in security-checklist#48
Closed
OktayCopurlu wants to merge 1 commit into
Closed
[Research] Modern CSRF protection via Sec-Fetch-Site in security-checklist#48OktayCopurlu wants to merge 1 commit into
OktayCopurlu wants to merge 1 commit into
Conversation
Token-based CSRF is now legacy: browsers have sent Sec-Fetch-Site on every request since Safari 16.4 (2023), and Go 1.25 promoted this pattern to stdlib via net/http.CrossOriginProtection (Aug 2025). Adds a new CSRF subsection with 7 checklist items covering safe-method bypass, Sec-Fetch-Site enforcement, Origin fallback, and SameSite as defense-in-depth. Sources: - https://words.filippo.io/csrf/ (Filippo Valsorda, Aug 2025) - https://pkg.go.dev/net/http#CrossOriginProtection (Go 1.25 stdlib) - https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Sec-Fetch-Site - https://web.dev/articles/fetch-metadata - simonw/datasette#2689 (Datasette adoption, Apr 2026)
bdc0909 to
46e550b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Add a new CSRF Protection (Fetch Metadata) subsection to
references/security-checklist.mdwith 7 checklist items covering the modern header-based approach to CSRF:Sec-Fetch-Siteenforcement,Originfallback for older clients, safe-method bypass, andSameSitecookies as defense-in-depth.Why
Token-based CSRF is now legacy for most new services:
Sec-Fetch-Siteon every request since Safari 16.4 (March 2023) — coverage is effectively universal.net/http.CrossOriginProtection(August 2025), replacing the "use a framework" advice the Go team had given for a decade.Our
security-checklist.mdpreviously had no CSRF entry at all — only a single CORS line. Agents reviewing code today will miss CSRF concerns entirely, or worse, cargo-cult a token library when a 3-line middleware suffices.Evidence
Score (7-dimension rubric)
grep -i \"csrf\\|sec-fetch\\|same-site\" references/ skills/ prompts/returned zero hits before this changereviewing-codeandsecurity-hardeningskills; no new file, no README update neededTotal: 14/14
Change
One file modified:
references/security-checklist.md— inserted new subsection betweenAPI SecurityandData Handling. No new files, no skill rewrites, no cross-reference churn.