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

Should the default policy be invoked when trusted types are not required? #536

Closed
mbrodesser-Igalia opened this issue Jul 15, 2024 · 4 comments
Milestone

Comments

@mbrodesser-Igalia
Copy link
Collaborator

https://w3c.github.io/trusted-types/dist/spec/#get-trusted-type-compliant-string-algorithm step 3 returns if no trusted types are required.

That section is normative. The non-normative section about the default policy (https://w3c.github.io/trusted-types/dist/spec/#default-policy-hdr) doesn't mention that aspect.

It seems more intuitive to invoke the default policy.

@mbrodesser-Igalia mbrodesser-Igalia added this to the v1 milestone Jul 15, 2024
@mbrodesser-Igalia
Copy link
Collaborator Author

Chrome implements the normative behavior (e.g. https://jsfiddle.net/014ze36t/2/).

@koto
Copy link
Member

koto commented Jul 15, 2024

This is intentional. The default policy only works if there's a require-trusted-types-for directive. This is such that all trusted types related enforcement is controlled through the directive.

@mbrodesser-Igalia
Copy link
Collaborator Author

@mozfreddyb : what's Mozilla's position towards this?

CC @evilpie

@mozfreddyb
Copy link
Collaborator

mozfreddyb commented Sep 4, 2024

We agree with @koto. The default policy should be invoked only if there's a TT directive in CSP and not without a CSP directive.

@koto koto closed this as completed Oct 31, 2024
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

3 participants