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

Apps: orphan app WebWorkers' origins #797

Merged
merged 2 commits into from
May 27, 2019
Merged

Conversation

sohkai
Copy link
Contributor

@sohkai sohkai commented May 21, 2019

Orphans app WebWorkers to an opaque origin. Trying to access indexedDB now results in an error:

This wasn't a huge issue before, as WebWorkers have no access to localStorage or the DOM, but after we introduced localForage and indexedDB access, these WebWorkers all of a sudden were able to Do Bad ThingsTM (like write to an app's cache at will and influence another app's frontend).


Also gives the WebWorkers some names, for ease of debugging:

Screen Shot 2019-05-21 at 10 57 03 AM

workerUrl = await getBlobUrl(scriptUrl)
// have to fetch the script (from an IPFS gateway) and process it locally
// Note that we **HAVE** to use a data url, to ensure the Worker is
// created with an opaque origin
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we could also add here why we need an opaque origin, using the indexedDB access as an example?

@luisivan luisivan mentioned this pull request May 27, 2019
25 tasks
@sohkai sohkai merged commit 908a1f2 into master May 27, 2019
@sohkai sohkai deleted the webworker-dataurl-security branch May 27, 2019 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants