-
Notifications
You must be signed in to change notification settings - Fork 9
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
Enforce Snow integration with CSP #118
Merged
Conversation
This file contains 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
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 |
Continuing #118 (comment), in 20aae8b we introduce CSP support for object-src too |
weizman
changed the title
start thinking about snow with csp
Enforce Snow integration with CSP
Jul 17, 2023
This was referenced Jul 17, 2023
Merged
This was referenced Jul 17, 2023
Merged
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-inline
is not allowed!script-src
directive to anything as long as it doesn't include the phraseunsafe-inline
object-src
toself
is not allowed!object-src
directive to anything as long as it doesn't include the phraseself
Motivation
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
-object
s andembed
s are also very problematic in their behaviour around contentWindow access and load event emittersIn this PR
script-src 'self'; object-src 'none';
securitypolicyviolation
event in all realms by defaultdocument.body.innerHTML = '<iframe src="javascript:alert()" />'
will pass withCSP-script-src-elem
detecteddocument.write
we have to integrate a static check instead of expecting the event listener to fire - this is becausedocument.write
kills event listeners on the document by definition, includingsecuritypolicyviolation
example.com
as the same origin to a new apphttps://weizman.github.io/CSPer/
which accepts a query paramcsp
and sets its value as the CSP of the document using themeta
tag.Notes
facebook.com
want 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-inline
andunsafe-eval
attacks; (3) forbidobject-src
by pointing it to eithernone
or to any domain that isn't the same domain as your app