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

Shared Storage Return Times Outside of Worklet Appear to Be Dependent on Activity in Worklet #136

Open
anisenoff opened this issue Feb 20, 2024 · 1 comment

Comments

@anisenoff
Copy link

It appears that you can influence the return times of calls to the shared storage API outside of the worklet by making calls to the API from inside the worklet. Below are histograms of the return times (relative to page navigation) from repeatedly calling window.sharedStorage.set from outside of the worklet in three scenarios.

If you don’t have anything happening in the worklet the return times create the histogram below.

without_2

If you also constantly call window.sharedStorage.set from inside of the worklet you get the following histogram of return times.

full_2

If you repeatedly call window.sharedStorage.set for periods of two seconds and then do nothing for two seconds from inside of the worklet you get the following histogram.

with_2

By looking at the return times of the function calls outside of the worklet you can learn about what is happening inside the worklet which can be based on information that has been stored in shared storage.

For reference, these graphs were generated in Chrome version 121.

@menonasha
Copy link

Hi @anisenoff , thanks for the report! We can think through potential mitigations here such as making set return instantly, rate limiting the number of sets and get calls as a mitigation, or limiting the duration of the worklet. However similar to the response for issue #86, we'd like to note that while this particular side-channel could be mitigated, not all can and we potentially need to lean on after-the-fact analysis to detect these patterns and adapt over time.

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

No branches or pull requests

2 participants