Don't add preload links to CSP#740
Open
gapple wants to merge 1 commit into
Open
Don't add preload links to CSP#740gapple wants to merge 1 commit into
gapple wants to merge 1 commit into
Conversation
|
@gapple is attempting to deploy a commit to the Baroshem's projects Team on Vercel. A member of the Team first needs to authorize it. |
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
Sign up for free
to 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.
Types of changes
Description
1: Remove hashes for preload links
Currently, all
<link rel="preload" as="script">elements' integrity hashes are added to the CSP header'sscript-srcdirective ifssg.hashScriptsis enabled, leading to unnecessarily long header lengths that are not supported by all hosts #606According to https://groups.google.com/a/chromium.org/g/blink-dev/c/9r2SuJQuWBM/m/UcJiPfm1AgAJ prefetching is controlled by
default-src, andscripts-srcis only checked when the script is inserted into the page for execution.As long as
strict-dynamicis included inscript-src, only the entry script (and inline scripts) need to be added to the policy, and that trust is propagated to any additional scripts that it loads.2: Configurable hash algorithm
It seemed trivial to make the hash algorithm configurable. Tests currently rely on the default remaining
SHA-256in order to differentiate between inline (hashed with the default algorithm) and external scripts (integrity attribute with SHA-384 hash).Checklist: