Conversation
Member
Author
|
858059e is a big one (with e19c70e also):
In 60dfa89 we discover some FF issues that seem to be bigger than this change. This makes it even clearer that in addition to the decided CSP above we should introduce |
Member
Author
|
Continuing #118 (comment), in 20aae8b we introduce CSP support for object-src too |
This was referenced Jul 17, 2023
Merged
This was referenced Jul 17, 2023
Merged
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.
tl;dr
unsafe-inlineis not allowed!script-srcdirective to anything as long as it doesn't include the phraseunsafe-inlineobject-srctoselfis not allowed!object-srcdirective to anything as long as it doesn't include the phraseselfMotivation
unsafe-inline&unsafe-eval- These 2 are allowing most of the vulns that are too hard to patch, string-JS based attacks are difficult to hermetically defend against.object-src-objects andembeds are also very problematic in their behaviour around contentWindow access and load event emittersIn this PR
script-src 'self'; object-src 'none';securitypolicyviolationevent in all realms by defaultdocument.body.innerHTML = '<iframe src="javascript:alert()" />'will pass withCSP-script-src-elemdetecteddocument.writewe have to integrate a static check instead of expecting the event listener to fire - this is becausedocument.writekills event listeners on the document by definition, includingsecuritypolicyviolationexample.comas the same origin to a new apphttps://weizman.github.io/CSPer/which accepts a query paramcspand sets its value as the CSP of the document using themetatag.Notes
facebook.comwant to use Snow, provide them with an easy way to take their current CSP and test it with Snow's current tests to see if it cuts it.unsafe-inlineandunsafe-evalattacks; (3) forbidobject-srcby pointing it to eithernoneor to any domain that isn't the same domain as your app