Sec-Fetch-* request metadata
Browsers add headers saying where a request came from and why, which servers use to block cross-site abuse.
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
| Browser | Status | First version | Released | Note |
|---|---|---|---|---|
| Chrome | Supported | 76 | 2019-07-30 | None |
| Edge | Supported | 79 | 2020-01-15 | None |
| Firefox | Supported | 90 | 2021-07-13 | None |
| Safari | Supported | 16.4 | 2023-03-27 | None |
| Safari on iPhone | Supported | 16.4 | 2023-03-27 | None |
| Chrome on Android | Supported | 76 | 2019-07-30 | None |
| Samsung Internet | Supported | 12.0 | 2020-06-19 | None |
How a site asks for it
| API | Sec-Fetch-Site, Sec-Fetch-Mode, Sec-Fetch-Dest, Sec-Fetch-User |
| Browser compat keys | http.headers.Sec-Fetch-Site |
| How access is granted | none |
| What the user sees | Not listed |
| Needs a secure context (HTTPS) | No |
| Needs a user gesture | No |
| How long it lasts | Not listed |
| How to take it back | Not listed |
| Inside an iframe | Not listed |
Typical flow
- Browser adds headers automatically
- Server evaluates policy
Data you get
What comes back: 4 headers
Shape: list
| Field | Type | Unit | Range | Precision |
|---|---|---|---|---|
Sec-Fetch-Site | string | None | same-origin, same-site, cross-site, none | exact |
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
| Type | Example | Apps |
|---|---|---|
| banking | A 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 |
| social | A social site only returns private profile data to requests from its own pages, so other sites cannot read it through hidden calls. | None named |
| games | A 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 |
| productivity | A web editor such as Google Docs protects document data so other sites cannot load it into a hidden frame. | Google Docs |
| media | A streaming site blocks other sites from embedding its video files by checking the destination label. | None named |
| developer | An engineer adds a middleware that drops cross site requests to private APIs, then watches the logs for blocked probes. | None named |
| security | A 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
| Score | Value | Meaning |
|---|---|---|
| Sensitivity | 1 of 5 | How revealing the data is |
| Utility | 3 of 5 | How useful it is to honest apps |
| Friction | 0 of 5 | How much the user has to do |
| Fingerprint bits | 1 | Rough 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
Related capabilities
Related
- Bot detection and CAPTCHA signals. Can combine many browser and network clues to guess if you are a bot
Sources
How well checked: Based on official documentation.