Skip to content

[worklets] Fill in privacy and security sections of worklets. #379

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

Closed
wants to merge 2 commits into from

Conversation

bfgeek
Copy link
Contributor

@bfgeek bfgeek commented Apr 7, 2017

Fixes #92. (better late than never? ;)

Broadly speaking worklets should be allowed in non-secure contexts as
downstream specs may want to use them there.

CSP wise this should work the same as workers, using the "child-src"
directive. I've filed issue #378 to allow each downstream spec to use a
unique destination, e.g. "paintworklet", "audioworklet", etc.

The CSP spec should probably be extended to have a "worklet-src"
directive (as there is now a "worker-src" directive now?).

Fixes #92. (better late than never? ;)

Broadly speaking worklets should be allowed in non-secure contexts as
downstream specs may want to use them there.

CSP wise this should work the same as workers, using the "child-src"
directive. I've filed issue #378 to allow each downstream spec to use a
unique destination, e.g. "paintworklet", "audioworklet", etc.

The CSP spec should probably be extended to have a "worklet-src"
directive (as there is now a "worker-src" directive now?).
@tabatkins tabatkins added the ready label Apr 7, 2017
@bfgeek
Copy link
Contributor Author

bfgeek commented Apr 7, 2017

@annevk @mikewest PTAL - :)

Copy link
Member

@annevk annevk left a comment

Choose a reason for hiding this comment

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

Overall it's not clear to me what the use of these sections are, apart maybe from the first paragraph about usable API surface, but that should probably be placed elsewhere?

useful functionality.

Worklets are allowed to be used outside <a>SecureContexts</a> as specifications which extend/use
worklets may be allowed to used outside <a>SecureContexts</a>.
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure that's really good rationale. Ideally all new features just require secure contexts and certainly any specifications which wish to use worklets could do the same.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right - I don't think we have consensus as user agents yet that this is the case for all new features, which is why I worded it this way.

I've changed it to
"Specifications which use worklets should decide if their worklet(s) should be allowed outside SecureContexts". instead?

The behaviour of loading scripts can be restricted by using <a>child-src</a> [[CSP]] directive. Each
specification which extends this specification <em>must</em> provide a <a
for=request>destination</a> which is sent along with requests in the <a>Fetch a module worker script
graph</a> algorithm.
Copy link
Member

Choose a reason for hiding this comment

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

Actually, worklets should be guarded by the script directive. But also, I'm not sure that needs to be mentioned in this section.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've removed this section.

@annevk annevk mentioned this pull request Apr 13, 2017
useful functionality.

Specifications which use worklets should decide if their worklet(s) should be allowed outside
<a>SecureContexts</a>.
Copy link
Member

Choose a reason for hiding this comment

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

I'd much rather we just limit them to secure contexts. No real reason to have new globals without it I think.

Copy link
Member

Choose a reason for hiding this comment

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

@bfgeek: Have y'all thought about this feedback? Seeing the intent to ship threads for various worklet types without this fundamental question being answered worries me a bit.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've bought this up on blink-dev. I linked to the HoudiniTF discussion there and there wasn't a clear conclusion.
https://lists.w3.org/Archives/Public/www-style/2017Mar/0023.html

I still err towards the side that it should be the decision of downstream specifications to decide this, but the concrete question that we need to answer at the moment is if the CSS Paint API should be available only on secure contexts or not.

Copy link
Member

Choose a reason for hiding this comment

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

I don't see why this should be decided downstream. It's a complex new feature and it can be trivially restricted. There's no good reason to expose it insecurely.

(As for the concerns around paint worklet. If there's no media query for secure contexts, just add one.)

Choose a reason for hiding this comment

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

I think there are good reasons to expose it insecurely. But since the argument is not about CSS Paint specific concerns, but rather all new features, I commented on the relevant TAG issue. w3ctag/design-principles#75 (comment)

@domenic
Copy link
Contributor

domenic commented Oct 16, 2020

@annevk, do you think we should try to port any of this over to HTML? Similarly, do you think there are other security concerns we should discuss, per #92 ?

@annevk
Copy link
Member

annevk commented Oct 19, 2020

No, I don't think we should. These days I think security and privacy should be directly addressed in the relevant algorithms.

@annevk annevk closed this Oct 19, 2020
@annevk annevk deleted the worklets-security branch October 19, 2020 07:42
@syncbot syncbot restored the worklets-security branch December 23, 2020 06:18
@tabatkins tabatkins deleted the worklets-security branch May 13, 2021 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Worklets: Security considerations?
6 participants