Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[WebProfiler] Do not add src-elem CSP directives if they do not exist#36678
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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
ContributorAuthor
ndench commentedMay 4, 2020
I can't see how my change would have caused Appveyor to fail. Here's the error: |
Member
nicolas-grekas commentedMay 4, 2020 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Member
nicolas-grekas commentedMay 4, 2020
Thank you@ndench. |
Contributor
cs278 commentedMay 5, 2020
Great thanks, just tested this works as expected. 👍 |
fabpot added a commit that referenced this pull requestMay 13, 2020
…nch)This PR was merged into the 4.4 branch.Discussion----------[WebProfiler] Remove 'none' when appending CSP tokens| Q | A| ------------- | ---| Branch? | 3.4, 4.4, 5.0| Bug fix? | yes| New feature? | no| Deprecations? | no| Tickets |Fix#36645| License | MIT| Doc PR | n/a@nicolas-grekas asked me to to have a look at this after#36678.If a user has a CSP policy of `default-src 'none'`, then the WebProfiler copies `'none'` to `script-src` and `style-src` then adds other sources. This creates an invalid policy since `'none'` is only allowed when it's the only item in the source list.This will probably need to be merged into 3.4 first, I started on 4.4 so I can test in my current symfony project which requires 4.4.Commits-------967bc4a [WebProfiler] Remove 'none' when appending CSP tokens
This was referencedMay 31, 2020
Merged
Merged
Merged
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In the latest 3.4., 4.4. and 5.0.* branches the
script-src-elemandstyle-src-elemdirectives are added to the Content-Security-Policy header if they don't exist by copying thedefault-src. This causes browsers to ignore thescript-srcandstyle-srcdirectives which likely contain scripts and styles the developer wanted to allow.As mentioned in the fixed ticket, we shouldn't be adding these directives if they don't exist because the browser will automatically fallback to
script-srcandstyle-srcwhich we have already addedunsafe-inlenand thenonce-*to.This will need to be merged into 3.4, 4.4 and 5.0, but I was unsure which branch I am meant to base it off to start with. I've put it on 4.4 but can move it to another if required.