Skip to content

change(security): add Fetch Metadata request headers - #196

Draft
jdevalk wants to merge 1 commit into
mainfrom
add/fetch-metadata-2026-09-04
Draft

change(security): add Fetch Metadata request headers#196
jdevalk wants to merge 1 commit into
mainfrom
add/fetch-metadata-2026-09-04

Conversation

@jdevalk

@jdevalk jdevalk commented Sep 4, 2026

Copy link
Copy Markdown
Owner

What changed

New spec page: Fetch Metadata request headers/spec/security/fetch-metadata/, status: recommended, order: 63.

Also in this PR:

  • relatedSlugs wired on cookie-attributes, frame-ancestors and cross-origin-isolation.
  • Changelog entry 2026-09-04-fetch-metadata.md (added).
  • OG images regenerated (public/og/spec/security/fetch-metadata.png plus 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-site from outside and observe whether the server refuses it.

Primary sources

Status justification

recommended, not required. The web platform contract does not break without a resource isolation policy, and SameSite cookies plus CSRF tokens remain viable on their own — the page says explicitly that this is defence in depth alongside them, not a replacement. Not optional either: 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 / -Dest available everywhere from Safari 16.4, but Sec-Fetch-User has never shipped in Safari — which is why webstatus.dev reports the fetch-metadata web-feature as Baseline limited. The page calls this out twice (in ## What it is and ## Common mistakes): a rule that requires Sec-Fetch-User locks 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:check and npm run check:skill all pass. Every inline /spec/... link in the new page resolves against dist/.

Draft — not for merge without review.

🤖 Generated with Claude Code

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>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying specification-website with  Cloudflare Pages  Cloudflare Pages

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

View logs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant