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

The navigator.storage quota API returns stable identifiers #12370

Closed
fmarier opened this issue Oct 28, 2020 · 2 comments · Fixed by brave/brave-core#6622
Closed

The navigator.storage quota API returns stable identifiers #12370

fmarier opened this issue Oct 28, 2020 · 2 comments · Fixed by brave/brave-core#6622
Assignees
Labels
OS/Android Fixes related to Android browser functionality OS/Desktop privacy QA/No release-notes/exclude

Comments

@fmarier
Copy link
Member

fmarier commented Oct 28, 2020

Originally reported on https://hackerone.com/reports/1021114

On my machine, I see the following in Chrome and Brave:

> (await navigator.storage.estimate()).quota
1175370308812

but Firefox seems to cap it at 2GB:

(await navigator.storage.estimate()).quota
2147483648

We should probably do the following:

  1. Cap the value like Firefox.
  2. Reduce the granularity of the data.
  3. Farble.
@fmarier fmarier added privacy OS/Android Fixes related to Android browser functionality OS/Desktop labels Oct 28, 2020
@antonok-edm antonok-edm self-assigned this Oct 28, 2020
@antonok-edm
Copy link
Collaborator

Some additional context...

Chromium implementation details

On my Linux computer, the quota value ends up returning exactly the full storage space of my LVM home partition, scaled by 0.8 * 0.75. Not only is this a persistent identifier, this value is not even useful for websites interested in using using local storage because it reports space that is already occupied by other files.

navigator.storage spec

The official spec says:

The storage quota of a storage shelf is an implementation-defined conservative estimate of the total amount of bytes it can hold. This amount should be less than the total storage space on the device. It must not be a function of the available storage space on the device.

With an additional note about fingerprinting:

Directly or indirectly revealing available storage space can lead to fingerprinting and leaking information outside the scope of the origin involved.

The Chromium implementation is incorrect, as it directly reveals the amount of storage space normally, and reveals a capped amount of storage space in private browsing mode. This also makes it easy for websites to detect private browsing (see #11543).

Conclusion

Since the API is unusable as-is except for as a fingerprinting vector, the correct approach here should be to simply hard-code the value. 2GB is both consistent with Firefox's implementation and conveniently avoids private browsing detection.

@antonok-edm
Copy link
Collaborator

Labeled as QA/No since this is already covered by #11543.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OS/Android Fixes related to Android browser functionality OS/Desktop privacy QA/No release-notes/exclude
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants