Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache mode: security review #39

Closed
annevk opened this issue Apr 5, 2015 · 10 comments
Closed

Cache mode: security review #39

annevk opened this issue Apr 5, 2015 · 10 comments

Comments

@annevk
Copy link
Member

annevk commented Apr 5, 2015

It seems to some extent the new cache mode feature can be emulated using timing information. However, it is unclear whether that is sufficient justification to expose the information with more certainty.

Sharing whether the user has an entry in its HTTP cache does allow for fingerprinting and figuring out what sites a user visits. (Note that CORS doesn't really change this as far as I can tell.)

@mfalken
Copy link

mfalken commented May 7, 2015

Cache control options are tracked in https://crbug.com/453190

@igrigorik
Copy link
Member

Have we made any progress on this one?

FWIW, I agree with @mnot's assessment in w3c/ServiceWorker#585 (comment).

A slight tangent, but related to this issue: I hear a lot of requests from developers for being able to (a) observe if fetched resources came from HTTP cache, and (b) the size of the fetched resources. The primary use cases are typically for monitoring and enforcing data budgets, bandwidth-estimation, and diagnostics (e.g. detect resources that were, for whatever reason, delivered without compression; estimating and improving cache hit rates, etc).

To address the above both Nav and Resource Timing added {transfer, encodedBody, decodedBody}size (see RT), but implementations are blocked on similar concerns as discussed here.

I'd love to come to a resolution on this.

@KenjiBaheux
Copy link

I think same-origin is too restrictive.
Would it make sense if we were to allow probing for the assets an origin was already aware of?

  • assets that were potentially* placed in the cache by the origin in the past

In other words, if there is nothing new to learn from specific requests, it should be fine to allow them.

*effectively placed or merely requested.

@annevk
Copy link
Member Author

annevk commented Sep 17, 2015

@igrigorik came from is #40.

@annevk
Copy link
Member Author

annevk commented Sep 17, 2015

As for progress, no security folks have chimed in so no progress.

@mikewest
Copy link
Member

Hi! My initial reaction is that is a pretty terrible idea. I'm willing to be convinced otherwise, but I don't think that the assumptions being made here hold.

In short, timing attacks are different in kind from the kinds of attacks this API would enable. That is, there is a qualitative difference between a 100% effective API that would enable rapid brute-forcing of recently visited URLs/GET parameters, and a mostly effective hack that gave a certain probability of success with a large amount of slop and network traffic (and associated latency).

@annevk
Copy link
Member Author

annevk commented Sep 17, 2015

@mikewest do you mean any cache mode would be bad to expose to JavaScript? Or only certain modes?

@annevk
Copy link
Member Author

annevk commented Nov 5, 2015

Per http://krijnhoetmer.nl/irc-logs/whatwg/20151105#l-310 I should remove "only-if-cached" and keep the rest. No origin restrictions for now. This still allows for timing attacks and might make some of them more precise, but that was not considered problematic.

@annevk annevk closed this as completed in 886255d Nov 6, 2015
@mnot
Copy link
Member

mnot commented Nov 10, 2015

@mikewest Is it necessary to get rid of only-if-cached completely, or only make it same-origin?

@annevk
Copy link
Member Author

annevk commented Nov 10, 2015

I suspect same-origin might be okay, let's track that as a new issue and address it once implementations have shipped the current cache feature. That might already be tricky enough as-is.

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

No branches or pull requests

6 participants