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

[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
nicolas-grekas merged 1 commit intosymfony:3.4fromndench:fix-csp-src-elem
May 4, 2020

Conversation

@ndench
Copy link
Contributor

QA
Branch?3.4, 4.4, 5.0
Bug fix?yes
New feature?no
Deprecations?no
TicketsFix#36643
LicenseMIT
Doc PRn/a

In the latest 3.4., 4.4. and 5.0.* branches thescript-src-elem andstyle-src-elem directives are added to the Content-Security-Policy header if they don't exist by copying thedefault-src. This causes browsers to ignore thescript-src andstyle-src directives 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 toscript-src andstyle-src which we have already addedunsafe-inlen and 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.

adrienfr reacted with thumbs up emoji
@ndench
Copy link
ContributorAuthor

I can't see how my change would have caused Appveyor to fail. Here's the error:

There was 1 failure:1) Symfony\Bundle\FrameworkBundle\Tests\Functional\DebugAutowiringCommandTest::testNotConfusedByClassAliasesFailed asserting that '\r\nAutowirable Types\r\n=================\r\n\r\n The following classes & interfaces can be used as type-hints when autowiring:\r\n (only showing classes/interfaces matching ClassAlias)\r\n \r\n Symfony\Bundle\FrameworkBundle\Tests\Fixtures\ClassAliasExampleClass (public)\r\n\r\n\r\n' contains "Symfony\Bundle\FrameworkBundle\Tests\Fixtures\ClassAliasExampleClass (public)".C:\projects\symfony\src\Symfony\Bundle\FrameworkBundle\Tests\Functional\DebugAutowiringCommandTest.php:110

@nicolas-grekasnicolas-grekas added this to the3.4 milestoneMay 4, 2020
@nicolas-grekasnicolas-grekas changed the base branch from4.4 to3.4May 4, 2020 13:18
@nicolas-grekas
Copy link
Member

nicolas-grekas commentedMay 4, 2020
edited
Loading

I rebased this PR for 3.4.

@cs278 /@ampaze can you please have a look?

@ndench would you mind having a look at#36645 too?

ndench reacted with thumbs up emoji

@nicolas-grekas
Copy link
Member

Thank you@ndench.

@nicolas-grekasnicolas-grekas merged commitcf0d086 intosymfony:3.4May 4, 2020
@ndenchndench deleted the fix-csp-src-elem branchMay 5, 2020 00:29
@cs278
Copy link
Contributor

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
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

3.4

Development

Successfully merging this pull request may close these issues.

4 participants

@ndench@nicolas-grekas@cs278@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp