Cache timing history sniffing
Times how fast a resource loads to guess whether the person already visited a site.
In one line
Can time how fast something loads to guess if you visited a site before
Times how fast a resource loads to guess whether the person already visited a site.
A cached image or script loads in milliseconds, an uncached one in tens. Probing resources from other sites, or the status of a login, reveals browsing history. Cache partitioning mostly ended the cross-site variant.
What it can and can't do
What the user does: Nothing. It happens when the page loads
It can
- Time how fast an image or script loads
- Guess it was cached if it loads in a few milliseconds
- Learn if you have visited some sites or are logged in
It cannot
- See your full browsing history
- Work as well now that browsers keep separate caches per site
- Ask permission first
- See what you did on the other site
How it differs between platforms: Chrome, Edge, Firefox and Safari now partition the cache per site, which breaks most of this.
Browser support
| Browser | Status | First version | Note |
|---|---|---|---|
| Chrome | Not supported | Not available | :Mitigated by cache partitioning since 86 |
| Edge | Not supported | Not available | :Mitigated by cache partitioning since 86 |
| Firefox | Not supported | Not available | :Mitigated since 85 |
| Safari | Not supported | Not available | :Mitigated since 2013 (ITP and partitioned cache) |
| Safari on iPhone | Not supported | Not available | :Mitigated since 2013 (ITP and partitioned cache) |
| Chrome on Android | Not supported | Not available | :Mitigated by cache partitioning since 86 |
| Samsung Internet | Not supported | Not available | :Mitigated by cache partitioning since 86 |
How a site asks for it
| API | fetch/Image + performance.now(); PerformanceResourceTiming transferSize |
| 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
- Choose a resource unique to a target site
- Request it and measure timing
- Infer cached or not
Data you get
What comes back: Timing distribution threshold
Shape: boolean
| Field | Type | Unit | Range | Precision |
|---|---|---|---|---|
load time | float | ms | 1 to 300 | limited by timer |
Technical limits
- Same-site cache probing still works
- Partitioned caches make cross-site probing fail in all three major browsers
The story
What it is
A site times how fast something loads to guess if you have already visited another site.
For you
You never see it. A page asks for a picture from another site and watches how quickly it appears. A fast load suggests you have been there before. Newer browsers have mostly blocked this.
For makers
It once let a site learn your browsing history without asking. Browsers now keep a separate cache for each site. Researchers and security teams still test it, and old browsers can still be fooled.
Where you see it
| Type | Example | Apps |
|---|---|---|
| security | A researcher shows that a news page can tell if you visited a bank by timing a logo load. | None named |
| ads | An ad network guesses that you are in market for a car by checking which dealers' images are in cache. | None named |
| social | A social site checks whether you have seen a rival site recently to tune what it shows. | None named |
| shopping | A shop checks if you saw a competitor's product images to adjust a promo. | None named |
| developer | A web performance team uses cache timing in tests to see how much a page benefits from caching. | None named |
| news | A paywall tests whether you came from a certain site by checking for its assets. | None named |
| analytics | A security team reviews logs for pages that probe other sites' files. | None named |
Risks
- Mostly fixed in modern browsers
- Old browsers still exposed
What the platform says
- Google Chrome: HTTP cache partitioning. Chrome describes splitting the cache by site so one site cannot learn what you visited elsewhere.
Good uses and abuse
Legitimate uses
- None legit
Known abuse
- Browsing history leak, login state detection
Scores
| Score | Value | Meaning |
|---|---|---|
| Sensitivity | 3 of 5 | How revealing the data is |
| Utility | 1 of 5 | How useful it is to honest apps |
| Friction | 0 of 5 | How much the user has to do |
| Fingerprint bits | 4 | Rough identifying entropy, when known |
History
- 2013-01, Safari: Safari partitions HTTP cache by first party
- 2020-10, Chrome 86: HTTP cache partitioned by top-level site and frame site
- 2021-01, Firefox 85: Network partitioning including HTTP cache
Related capabilities
Related
- Visited link (:visited) history sniffing. Can't find which links you visited by testing link colours anymore
- ETag and HTTP cache supercookie. Can try to tag your browser with a hidden cached ID, though browsers now limit it
Sources
- Felten and Schneider, Timing Attacks on Web Privacy (2000)
- Chrome HTTP cache partitioning
- Firefox network partitioning
How well checked: Based on official documentation.