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

Allow None as value for Service-Worker-Allowed. #1165

Open
surma opened this issue Jun 30, 2017 · 1 comment
Open

Allow None as value for Service-Worker-Allowed. #1165

surma opened this issue Jun 30, 2017 · 1 comment

Comments

@surma
Copy link
Member

surma commented Jun 30, 2017

In a multi-tenant system, where untrusted users have control over subdirectories, it would be nice to disable ServiceWorkers completely for paths outside the “user’s jail”.

Here’s an example:

/
|
+- /users
   |
   +- /userA
   +- /userB
   +- ...
+- /data
+- ...

A simple oversight like a missing trailing slash (/users/userA instead of /users/userA/) could allow installing a ServiceWorker outside the user’s jail.

Currently, you can kinda disable ServiceWorker by setting a non-sensical value for the Service-Worker-Allowed header, but I’d prefer a more semantic None (or similar).

@jakearchibald
Copy link
Contributor

The problem here is that None is a valid path.

All service worker script fetches have a Service-Worker: script header, so servers can return an invalid response in return.

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