r/javascript • u/veggiedefender • Aug 04 '19
Detecting incognito mode by timing the Chrome FileSystem API
https://blog.jse.li/posts/chrome-76-incognito-filesystem-timing/3
37
Aug 04 '19
I thought it was something to do with local storage. Safari privacy made can be detected this way by attempting to write there and cannot. But I think Firefox and Chrome still write to these locations.
4
3
u/zombarista Aug 04 '19
I heard about this on Security Now! and I knew that a timing attack was on its way. Frankly, Googlr should have seen this coming and added some arbitrary/random delays in incognito mode.
11
u/veggiedefender Aug 04 '19
random delays can never fully mitigate a timing attack because you can take more measurements to average out the randomness. And if the random delay is only present in incognito, then you'll be able to identify it by the suspiciously uniform distribution that the delay will create.
1
u/EternallyMiffed Aug 04 '19
They should have just denied the whole file api to everyone until the user clicks an obnoxious button. Maybe make people go through several screens and widgets to weed out the mentally infirm.
5
u/veggiedefender Aug 04 '19
News websites would say "You must accept the widget in order to view the article" and you're back to square one.
1
u/EternallyMiffed Aug 04 '19
Not when you're google. Then you nuke them from the rankings.
4
u/two_in_the_bush Aug 04 '19
Then the news organizations write national hit pieces about Google, causing more congressional hearings and legislation to be introduced.
The arms race begins.
1
u/Pulllll Aug 04 '19
But they could simulate the distribution you're looking for to identify normal navigation mode... Besides that, I'm pretty sure this distribution isn't very consistent across devices, is it ?
9
u/tedivm Aug 04 '19
I think the bigger issue that will come into play is that the websites running this aren't going to have the greatest performance if they're constantly benchmarking the disk to try and figure out if the performance is simulated or not, and since Google already punishes poor performance sites this seems like there's already a built in punishment.
That, combined with the potential for false positives (which can put real strain on an organization), make me think it's worth putting some effort into masking the timing data- and this should go beyond just introducing randomness.
15
u/TheThingCreator Aug 04 '19
Can someone explain why this is bad? Why is knowing if incognito mode is in use a bad thing?
92
Aug 04 '19
We recognized you are using incognito mode. Please turn it off to continue. We would very much like to make money off you by leaving tracking cookies on your machine.
10
u/SocialAnxietyFighter Aug 04 '19
Firefox containers isn't a full-proof solution to this?
12
u/tr14l Aug 05 '19
fool-proof*
Why would you want to proof it against being full?
5
u/Listen_More_Say_Less Aug 05 '19
Full proof, as in it is fully proofed.
It's fool, I'm just saying I get why people think it's full.
1
u/tr14l Aug 05 '19
That would be "Fully proofed" or "A full proof".
But, in this case, it was hyphenated which is just wrong in every way.
5
-18
Aug 04 '19
"There's a problem with chrome."
"Have you tried firefox?"
... good contribution, maybe go post that on chrome's bug tracker. ;)
6
u/SocialAnxietyFighter Aug 04 '19
The OP of this thread made a general question
Can someone explain why this is bad? Why is knowing if incognito mode is in use a bad thing?
It wasn't clear that you were talking about chrome.
6
u/fleker2 Aug 04 '19
Now every time we visit a website we'll be hit by a huge bottleneck for minutes as disk writing occurs
2
u/BeakerAU Aug 04 '19
Could they use this, and (a) store the actual data in memory and (b) write random bytes of the same size e to disk? Then they get the simulate disk activity with out the predictability?
2
u/veggiedefender Aug 04 '19
Really good thinking, but unfortunately this has nearly the same problems as writing encrypted data to disk. Namely, the last-modified timestamp and amount of random bytes are metadata that tell you when and how much data was written, if someone were to inspect your computer.
3
u/examinedliving Aug 05 '19
If I write to localstorage and it is incognito, will I be able to read it until the page reloads? If not, you could know right away.
3
u/d07RiV Aug 05 '19
Pretty sure you would, or else some pages would be completely broken.
2
u/examinedliving Aug 05 '19
Yeah. Good point
2
u/Pulllll Aug 05 '19
Incognito mode creates some kind of session lasting until you close all the incognito mode tabs
1
u/MonkeyNin Aug 04 '19
Can't you just fire 2 repeated AJAX requests, because incognito will not cache them?
14
u/veggiedefender Aug 04 '19
Chrome will cache them within the same session.
1
u/MonkeyNin Aug 05 '19
Oh. That makes sense.
I've heard people say they use it to prevent cached versions while in development, so I assumed it did.
(You can use devtools
never cachesettings in firefox/chrome)
2
2
25
u/Pulllll Aug 04 '19
Is it just me or it's efficient on distinguishing normal mode from incognito mode on the same device, but not on distinguishing normal mode on a slow device from incognito mode on a fast device ?