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

[Embedded Enforcement] Introduce a way to only validate nonce usage #495

Closed
shhnjk opened this issue May 15, 2021 · 2 comments
Closed

[Embedded Enforcement] Introduce a way to only validate nonce usage #495

shhnjk opened this issue May 15, 2021 · 2 comments

Comments

@shhnjk
Copy link
Member

shhnjk commented May 15, 2021

When using CSP Embedded Enforcement, embedder maybe only interested in enforcing nonce-based CSP, but doesn't care much about what the nonce value is.

From reading existing spec, it seems like exact nonce value has to match, which introduces complexity to embeddee, where it has to parse request header and apply same nonce value to its document.

We probably should introduce a way to validate that the nonce is being used in embeddee, but makes no actual value checks.

Example:

<iframe src="https://example.tld" csp="script-src 'enforce-nonce'"></iframe>
@antosart
Copy link
Member

According to the spec, nonces do not have to match, see https://w3c.github.io/webappsec-cspee/#subsume-source-expressions §4.1 (and in particular the note).

In practice, specifying 'nonce-xxx' for any xxx in the csp attribute has the effect of the keyword 'enforce-nonce' you are proposing.

We could think of having such a keyword instead, since it could be less confusing for developers.

@shhnjk
Copy link
Member Author

shhnjk commented May 17, 2021

Good to know, thanks!

@shhnjk shhnjk closed this as completed May 17, 2021
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