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

chore: remove obsolete csp header #16664

Merged
merged 2 commits into from
Sep 11, 2024

Conversation

miketheman
Copy link
Member

Introduced in #1105.

It is now obsolete, because all mixed content is now blocked if it can’t be autoupgraded.

Refs: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/block-all-mixed-content
Refs: https://www.w3.org/TR/mixed-content/#strict-checking

Introduced in #1105.

> It is now obsolete, because all mixed content is now blocked if it can’t be autoupgraded.

Refs: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/block-all-mixed-content
Refs: https://www.w3.org/TR/mixed-content/#strict-checking

Signed-off-by: Mike Fiedler <miketheman@gmail.com>
@miketheman miketheman added the security Security-related issues and pull requests label Sep 9, 2024
@miketheman miketheman requested a review from a team as a code owner September 9, 2024 17:25
@ewdurbin
Copy link
Member

ewdurbin commented Sep 9, 2024

Seems fine given docs, but is there harm in leaving it? I'm curious how this impacts older browsers that may have been enforcing the directive.

@miketheman
Copy link
Member Author

The harm I can currently conceive is that we emit a small amount of extra bytes in every header, and browsers like Firefox emit a warning.

The standard appears to try to have browsers upgrade insecure by default, and block anything not upgradable.
Since we already implement HSTS, browsers should either load resources over HTTPS or block them automatically.

@miketheman miketheman enabled auto-merge (squash) September 11, 2024 13:16
@miketheman miketheman merged commit 8947dd8 into pypi:main Sep 11, 2024
18 checks passed
@miketheman miketheman deleted the miketheman/remove-invalid-csp branch September 11, 2024 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
security Security-related issues and pull requests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants