Skip to Content
Platform.Ontology

Sec-Fetch-* request metadata

Browsers add headers saying where a request came from and why, which servers use to block cross-site abuse.

Gets silentlyNetwork and connectionHeadersWeb browsersWhen the page loads

In one line

Can tell why a request was sent, such as a click or a script

Browsers add headers saying where a request came from and why, which servers use to block cross-site abuse.

Sec-Fetch-Site, Mode, Dest and User tell the server if a request is same-origin, a navigation, or user triggered. They are not user identifying but help servers tell real browsers from scripts.

What it can and can't do

What the user does: Nothing. Your browser adds it to every request automatically

It can

  • See whether a request came from the same site, another site, or from you directly
  • See whether it came from a click, a typed address or a page script
  • Block suspicious cross site requests and bots that lack the right labels

It cannot

  • See your name, location or account from these labels
  • Be changed by the page, since the browser sets them
  • Tell which person you are
  • Learn which other pages you visited

Browser support

BrowserStatusFirst versionReleasedNote
ChromeSupported762019-07-30None
EdgeSupported792020-01-15None
FirefoxSupported902021-07-13None
SafariSupported16.42023-03-27None
Safari on iPhoneSupported16.42023-03-27None
Chrome on AndroidSupported762019-07-30None
Samsung InternetSupported12.02020-06-19None

How a site asks for it

APISec-Fetch-Site, Sec-Fetch-Mode, Sec-Fetch-Dest, Sec-Fetch-User
Browser compat keyshttp.headers.Sec-Fetch-Site
How access is grantednone
What the user seesNot listed
Needs a secure context (HTTPS)No
Needs a user gestureNo
How long it lastsNot listed
How to take it backNot listed
Inside an iframeNot listed

Typical flow

  1. Browser adds headers automatically
  2. Server evaluates policy

Data you get

What comes back: 4 headers
Shape: list

FieldTypeUnitRangePrecision
Sec-Fetch-SitestringNonesame-origin, same-site, cross-site, noneexact

Technical limits

  • Absent from non-browser clients, making them a bot signal
  • Cannot be set by page script

The story

What it is

Browsers label each request with where it came from and why, so servers can reject cross site abuse.

For you

You never see these labels, but they help protect you. They let sites refuse a request that a hostile page secretly sent using your logged in session.

For makers

Makers add a short rule on the server: only accept some requests from their own pages. It blocks forged requests and data leaks across sites. Because browsers set the labels, a page cannot fake them.

Where you see it

TypeExampleApps
bankingA bank's server refuses a money transfer sent by another site, because the label says it came from a different site and was not a normal navigation.None named
socialA social site only returns private profile data to requests from its own pages, so other sites cannot read it through hidden calls.None named
gamesA browser game's account server rejects score submissions that do not come from its own game page, which cuts simple cheating by third party scripts.None named
productivityA web editor such as Google Docs protects document data so other sites cannot load it into a hidden frame.Google Docs
mediaA streaming site blocks other sites from embedding its video files by checking the destination label.None named
developerAn engineer adds a middleware that drops cross site requests to private APIs, then watches the logs for blocked probes.None named
securityA security team uses the labels to spot probing from a malicious page in the access logs.None named

Risks

  • Rules can break features
  • Not a full defence

What the platform says

  • web.dev: Fetch Metadata. Servers can use these labels to block requests that are not meant for them, as a defence against many web attacks.

Good uses and abuse

Legitimate uses

  • CSRF and XSSI defense (resource isolation policies)

Known abuse

  • Bot detection

Scores

ScoreValueMeaning
Sensitivity1 of 5How revealing the data is
Utility3 of 5How useful it is to honest apps
Friction0 of 5How much the user has to do
Fingerprint bits1Rough identifying entropy, when known

History

  • 2019-07, Chrome 76: Fetch Metadata shipped
  • 2021-07, Firefox 90: Fetch Metadata shipped
  • 2023-03, Safari 16.4: Fetch Metadata shipped

Sources

How well checked: Based on official documentation.

On this page