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

Disable CSP header on exception pages only in debug#25933

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:2.7fromostrolucky:more-secure-csp-removal
Jan 26, 2018

Conversation

@ostrolucky
Copy link
Contributor

@ostroluckyostrolucky commentedJan 26, 2018
edited
Loading

QA
Branch?2.7
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#24772
LicenseMIT
Doc PR

Based on a feedback we received, there are situations on production when it's desired to have CSP header in place even if exception occurred.

This uses now same condition that is used by ExceptionController in TwigBridge to evaluate if styled exception template is going to be shown, minusshowException request attribute which don't make sense in this context, because it's used by PreviewController only and in such case this listener isn't triggered.

Overriding CSP header via HTML meta tag unfortunately, but not surprisingly, doesn't work.

Same condition is used by default TwigBridge ExceptionControllerto evaluate if styled exception page is supposed to be shown.
@nicolas-grekasnicolas-grekas added this to the2.7 milestoneJan 26, 2018
@fabpot
Copy link
Member

Thank you@ostrolucky.

@fabpotfabpot merged commitb77538c intosymfony:2.7Jan 26, 2018
fabpot added a commit that referenced this pull requestJan 26, 2018
…lucky)This PR was merged into the 2.7 branch.Discussion----------Disable CSP header on exception pages only in debug| Q             | A| ------------- | ---| Branch?       | 2.7| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#24772| License       | MIT| Doc PR        |Based on a feedback we received, there are situations on production when it's desired to have CSP header in place even if exception occurred.This uses now same condition that is used by ExceptionController in TwigBridge to evaluate if styled exception template is going to be shown, minus `showException` request attribute which don't make sense in this context, because it's used by PreviewController only and in such case this listener isn't triggered.Overriding CSP header via HTML meta tag unfortunately, but not surprisingly, doesn't work.Commits-------b77538c Disable CSP header on exception pages only in debug
@stof
Copy link
Member

Overriding CSP header via HTML meta tag unfortunately, but not surprisingly, doesn't work.

That's logic: the meta tag can add a new header, not replace the HTTP headers. And the behavior of browsers when receiving multiple CSP headers is to apply all policies (making a AND between them). So a new header cannot disable the other ones.

{
protected$controller;
protected$logger;
protected$debug;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

should have been private (too bad that I see it justafter the release is done)

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@stofstofstof left review comments

@fabpotfabpotfabpot approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

2.7

Development

Successfully merging this pull request may close these issues.

5 participants

@ostrolucky@fabpot@stof@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp