change(security): add Fetch Metadata request headers - #196
Draft
jdevalk wants to merge 1 commit into
Draft
Conversation
Browsers have sent Sec-Fetch-Site / -Mode / -Dest on every request since Safari 16.4 completed support in March 2023, and OWASP now names them a primary CSRF defence. Nothing in the spec covered them beyond a passing mention on cookie-attributes. Status is `recommended`: the platform contract does not break without a resource isolation policy, and SameSite plus CSRF tokens remain the alternatives it sits alongside. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Deploying specification-website with
|
| Latest commit: |
50576e0
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://33012751.specification-website.pages.dev |
| Branch Preview URL: | https://add-fetch-metadata-2026-09-0.specification-website.pages.dev |
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 changed
New spec page: Fetch Metadata request headers —
/spec/security/fetch-metadata/,status: recommended,order: 63.Also in this PR:
relatedSlugswired oncookie-attributes,frame-ancestorsandcross-origin-isolation.2026-09-04-fetch-metadata.md(added).public/og/spec/security/fetch-metadata.pngplus the four count-driven images).npm run sign:skill— SKILL.md page count 168 → 169, digest re-signed.Why now
The spec had no page for
Sec-Fetch-Site/-Mode/-Dest— only a one-clause mention on cookie-attributes as a CSRF fallback. Support has been complete since Safari 16.4 (March 2023), and OWASP's CSRF cheat sheet now leads with Fetch Metadata rather than listing it as an extra, so this is a mature convention the spec was simply missing rather than an emerging one.It passes the auditable-outcome test cleanly: you can send a request with
Sec-Fetch-Site: cross-sitefrom outside and observe whether the server refuses it.Primary sources
Sec--prefixed names unforgeable from script (cited inline).Status justification
recommended, notrequired. The web platform contract does not break without a resource isolation policy, andSameSitecookies plus CSRF tokens remain viable on their own — the page says explicitly that this is defence in depth alongside them, not a replacement. Notoptionaleither: OWASP naming it a primary defence, on universal browser support, puts it above "depends on context".Browser-support nuance
BCD (via MDN MCP) shows
Sec-Fetch-Site/-Mode/-Destavailable everywhere from Safari 16.4, butSec-Fetch-Userhas never shipped in Safari — which is why webstatus.dev reports thefetch-metadataweb-feature as Baselinelimited. The page calls this out twice (in## What it isand## Common mistakes): a rule that requiresSec-Fetch-Userlocks out every Safari visitor. The three headers a policy actually gates on are fine.Not shipped here
The page carries the "specced, deliberately not shipped" note per CLAUDE.md. This site is static and cookieless — no session to ride, no state-changing endpoint — and the one endpoint that accepts
POST,/reports, is supposed to receive requests the user never initiated.Verification
npm run build,npm run lint,npm run format:checkandnpm run check:skillall pass. Every inline/spec/...link in the new page resolves againstdist/.Draft — not for merge without review.
🤖 Generated with Claude Code