Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Don't add csp-headers if none are required#21318

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fabpot merged 1 commit intosymfony:3.2fromarjenm:arjenm-fix-webprofiler-csp
Jan 17, 2017
Merged

Don't add csp-headers if none are required#21318

fabpot merged 1 commit intosymfony:3.2fromarjenm:arjenm-fix-webprofiler-csp
Jan 17, 2017

Conversation

@arjenm
Copy link
Contributor

@arjenmarjenm commentedJan 17, 2017
edited
Loading

QA
Branch?3.2
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed ticketsThis PR is also the ticket
LicenseMIT

In 3.2 a tool to adjust Content Security Policy headers in combination with the WebProfiler was added. We encountered a bug in its behavior.
We had CSP-headers that did not have a script-src/style-src nor a default-src (it was something likeform-action: https:). In that scenario, the ContentSecurityPolicyHandler would addscript-src: 'unsafe-inline' 'nonce-....', but that would actually change the "everything is allowed scenario" into "only inline and nonce-... is allowed". The result wasonly the javascript of WebProfiler was allowed, rather than everything.

This PR fixes the scenario where no default-src nor a script-src/style-src is provided. It simply continue's rather than treats it as an empty list of rules that need additional rules.

A bug I did find, but not fix, is the fact that that'unsafe-inline' is ignored in at least Firefox and Chrome due to the fact there is also a nonce-element in the rule.

@stof
Copy link
Member

A bug I did find, but not fix, is the fact that that 'unsafe-inline' is ignored in at least Firefox and Chrome due to the fact there is also a nonce-element in the rule.

This isnot a bug.unsafe-inline combined with nonces is about supporting both CSP 1 and CSP 2 together

@arjenm
Copy link
ContributorAuthor

Ok, it doesn't really matter for my PR anyway, so I scratched that. Thanks for correcting me :)

@romainneutron
Copy link
Contributor

LGTM 👍

@fabpot
Copy link
Member

Thank you@arjenm.

@fabpotfabpot merged commit6fecc94 intosymfony:3.2Jan 17, 2017
fabpot added a commit that referenced this pull requestJan 17, 2017
This PR was merged into the 3.2 branch.Discussion----------Don't add csp-headers if none are required| Q             | A| ------------- | ---| Branch?       | 3.2| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets | This PR is also the ticket| License       | MITIn 3.2 a tool to adjust Content Security Policy headers in combination with the WebProfiler was added. We encountered a bug in its behavior.We had CSP-headers that did not have a script-src/style-src nor a default-src (it was something like `form-action: https:`). In that scenario, the ContentSecurityPolicyHandler would add `script-src: 'unsafe-inline' 'nonce-....'`, but that would actually change the "everything is allowed scenario" into "only inline and nonce-... is allowed". The result was _only_ the javascript of WebProfiler was allowed, rather than everything.This PR fixes the scenario where no default-src nor a script-src/style-src is provided. It simply continue's rather than treats it as an empty list of rules that need additional rules.~A bug I did find, but not fix, is the fact that that `'unsafe-inline'` is ignored in at least Firefox and Chrome due to the fact there is also a nonce-element in the rule.~Commits-------6fecc94 Don't add csp-headers if none are required
@fabpotfabpot mentioned this pull requestFeb 6, 2017
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

5 participants

@arjenm@stof@romainneutron@fabpot@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp