WICG / shared-storage

Explainer for proposed web platform Shared Storage API
Other
88 stars 21 forks source link

Problem with sharedStorage's described use of k-anonymity #39

Closed gtanzer closed 1 year ago

gtanzer commented 2 years ago

The explainer says:

""" selectURL() returns a promise that resolves into an opaque URL for the URL selected from urls.

"""

This design has the following flaw: The default URL is not necessarily k-anonymous and may be used to join first/third-party information. For example:

Let selectURL([url1, url2, url3]); pick url2 if some third party bit = 0 and url3 if the third party bit is 1. Let url3 be above the k-anonymity threshold, but not url1 or url2.

If the third party bit is 0 (or repeat with a different selection algorithm for 1), url1 will be loaded even though it isn't k-anonymous and joins a bit of cross-site data (e.g. the URL could be "https://evil.com?first_party_id=unique_id&third_party_bit=0"). You can repeat this process to extract arbitrarily many bits of cross-site data to the server (if the server is untrusted; otherwise you just get a single k-anonymity violation + 1-bit leak locally).

We want to ensure the following property:

We can achieve this with an additional check at the start, as follows:

pythagoraskitty commented 2 years ago

It seems that this attack will only work if the caller knows that url3 will be k-anonymous. Otherwise they are not guaranteed that their joined data from the default URL will be correct.

gtanzer commented 2 years ago

Whether URLs are k-anonymous is effectively public information, since you can query the server at a public endpoint (the same way Chrome client does). At worst, you could use a URL that you know to have reached the threshold by other means, e.g. that it is used in a very popular experiment.

pythagoraskitty commented 1 year ago

Closing since we decided not to use k-anon for now.