As mentioned in the readme, there is already skepticism of a privacy-preserving way for shared client storage.
"We acknowledge a downside with this approach related to lack of shared client storage for model weights — it would be a better experience if the browser only had to download large weights one time. We don’t know of a privacy-preserving way to do this, short of high level APIs like these which abstract away the details of inference."
- not a user need example, but rather skepticism of shared storage and suggesting high level inference apis instead. (the high level APIs they were referring to Writing Assistance APIs)
This api appears to try to cover 2 different use cases (for both data bandwidth and storage costs):
- Extremely common libraries (wasm/js/css/etc) that are usually relatively small (<10MB) e.g. jquery
- Extremely uncommon blobs greater than a GB. e.g. AI models
It appears this api was designed for common libraries which have less tracking/fingerprinting risk; the first case. But the motivating goals are for the second case (AI models). The Public Hash List implementation page suggests that AI models should be accepted even though they are uncommon. The exact set of large uncommon AI models cached carries a lot of entropy for fingerprinting. Even worse, it probably identifies the obscure sites the user that actually use each individual model, especially for models trained for specific purposes (like models trained to identify medical conditions).
Even the common libraries use case is a privacy problem. If a common library is only on specific kinds of sites (google, social media, etc), it gives away what kind of sites the user visits. And of course with enough common libraries, it will be uncommon to have them all making the set of cached libraries a fingerprinting vector. If a library is used on practically every site then if it is absent it is a strong signal the user is in incognito mode.
It is well known that bucketing users is a more effective privacy measure than randomizing api results (greasing). In this case, the 'greasing' will only be able to lie in one direction. It can't pretend to have something cached that it doesn't, so anything that is reported cached is known to not be a lie. Detecting fingerprinting attempts to stop api access will be a balancing act that will likely fail (ML is not the answer to all problems).
Solutions
Storage space on device fix
if both example.com and example.org each require the same 8 GB AI model, this would result in 16 GB of downloaded data and a total allocation of 16 GB on the user's device This can be solved today without any new api. If two sites store the exact same file the browser can dedup and just store one file with a note that both sites have it cached. Clearing storage for one site would clear the note that that site had it cached. This wouldn't allow a site to use cached files from another site before caching the files themselves, removing privacy risks. Thus even though 16GB of data is downloaded, only 8GB needs to be stored on the user's device. (in fact, this is solved already on some file systems where files are deduped automatically).
Common libraries over fetching fix
Common libraries have been over fetched forever. If it actually is a problem though, they should be bucketed instead of greased. That is, the set of common-files entries should be one of a few possible sets. Probably by storage capacity: small (1GB), medium (10GB) and large (100GB). Where each class contains all most common files under a certain storage size. Phones might use small, laptops might use medium, and desktops might use large. What is in each set shouldn't be updated very often, as that could reveal the last time the user updated.
The api for this could look largely the same as the current proposed cross-origin-storage, but with buckets instead of greasing and without the need to specify an origins list (the api would only be for things that are likely in one of the global buckets). To prevent developers from depending on files being in the current buckets, the buckets should not be used if the cache is turned off in devtools. To maximize effectiveness, the cross-origin-storage(shared-files) html attribute should only be needed if the site has a service worker, otherwise if the html integrity attribute matches that should be enough to benefit for existing sites.
Large files over fetching fix
Large uncommon files like game engines and AI models need a different solution. They need permission prompts. Thus the files need user friendly names. The hash and the name should match to be considered the same (so that a malicious actor can't confuse the user with a misleading name). There are a few cases here.
- The user has the large file cached by the same origin or has been allowed before
- The user has the large file cached by a different origin
Do you want to allow example.com to reuse file 'UnityWebEngineV1.zip' from the following sites to save 10GB of data? <bulleted list of origins>.
- The user doesn't have the file cached
- we need a permission prompt here to prevent timing attacks, so:
example.com wants file 'UnityWebEngineV1.zip', do you want to select it locally to save 10GB of data? followed by a file picker if yes. If the user actually has the file locally and selects it, it should first be copied to browser storage so that it will be immediately available on subsequent visits.
The api for this could also look largely the same as the current proposed cross-origin-storage, but with a name field and again no need for an origins list. This shouldn't be the same api as the one for common libraries, as those shouldn't require permission prompts.
As mentioned in the readme, there is already skepticism of a privacy-preserving way for shared client storage.
This api appears to try to cover 2 different use cases (for both data bandwidth and storage costs):
It appears this api was designed for common libraries which have less tracking/fingerprinting risk; the first case. But the motivating goals are for the second case (AI models). The Public Hash List implementation page suggests that AI models should be accepted even though they are uncommon. The exact set of large uncommon AI models cached carries a lot of entropy for fingerprinting. Even worse, it probably identifies the obscure sites the user that actually use each individual model, especially for models trained for specific purposes (like models trained to identify medical conditions).
Even the common libraries use case is a privacy problem. If a common library is only on specific kinds of sites (google, social media, etc), it gives away what kind of sites the user visits. And of course with enough common libraries, it will be uncommon to have them all making the set of cached libraries a fingerprinting vector. If a library is used on practically every site then if it is absent it is a strong signal the user is in incognito mode.
It is well known that bucketing users is a more effective privacy measure than randomizing api results (greasing). In this case, the 'greasing' will only be able to lie in one direction. It can't pretend to have something cached that it doesn't, so anything that is reported cached is known to not be a lie. Detecting fingerprinting attempts to stop api access will be a balancing act that will likely fail (ML is not the answer to all problems).
Solutions
Storage space on device fix
if both example.com and example.org each require the same 8 GB AI model, this would result in 16 GB of downloaded data and a total allocation of 16 GB on the user's deviceThis can be solved today without any new api. If two sites store the exact same file the browser can dedup and just store one file with a note that both sites have it cached. Clearing storage for one site would clear the note that that site had it cached. This wouldn't allow a site to use cached files from another site before caching the files themselves, removing privacy risks. Thus even though 16GB of data is downloaded, only 8GB needs to be stored on the user's device. (in fact, this is solved already on some file systems where files are deduped automatically).Common libraries over fetching fix
Common libraries have been over fetched forever. If it actually is a problem though, they should be bucketed instead of greased. That is, the set of common-files entries should be one of a few possible sets. Probably by storage capacity: small (1GB), medium (10GB) and large (100GB). Where each class contains all most common files under a certain storage size. Phones might use small, laptops might use medium, and desktops might use large. What is in each set shouldn't be updated very often, as that could reveal the last time the user updated.
The api for this could look largely the same as the current proposed cross-origin-storage, but with buckets instead of greasing and without the need to specify an origins list (the api would only be for things that are likely in one of the global buckets). To prevent developers from depending on files being in the current buckets, the buckets should not be used if the cache is turned off in devtools. To maximize effectiveness, the cross-origin-storage(shared-files) html attribute should only be needed if the site has a service worker, otherwise if the html integrity attribute matches that should be enough to benefit for existing sites.
Large files over fetching fix
Large uncommon files like game engines and AI models need a different solution. They need permission prompts. Thus the files need user friendly names. The hash and the name should match to be considered the same (so that a malicious actor can't confuse the user with a misleading name). There are a few cases here.
Do you want to allow example.com to reuse file 'UnityWebEngineV1.zip' from the following sites to save 10GB of data? <bulleted list of origins>.example.com wants file 'UnityWebEngineV1.zip', do you want to select it locally to save 10GB of data?followed by a file picker if yes. If the user actually has the file locally and selects it, it should first be copied to browser storage so that it will be immediately available on subsequent visits.The api for this could also look largely the same as the current proposed cross-origin-storage, but with a name field and again no need for an origins list. This shouldn't be the same api as the one for common libraries, as those shouldn't require permission prompts.