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

CSP: Get and pass jss nonce to options if it exists #168

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

seromenho
Copy link

@seromenho seromenho commented Jan 26, 2021

Seems the integrations is using inline styles (having CSP violation only in mobile. desktop works fine) meaning that CSP style-src rule need to allow unsafe-inline.
This PR is a suggestion on how we can use the nonce technique for the style-src rule.
This nonce will then need to be captured and set on link-initialize.js.

Please let me know what do you think, or if there's some other alternative.

Thanks

#118 is kinda related

@skylarmb
Copy link
Contributor

skylarmb commented Jan 27, 2021

hi @seromenho we have an internal ticket to track this and #118. Thanks! I'll make sure to update here if there is anything to share.

Merging your PR as-is would not do anything as Link does not accept a nonce parameter, so leaving this PR open until we implement that or another solution to the unsafe-inline issue.

@seromenho
Copy link
Author

seromenho commented Jan 27, 2021

Hey @skylarmb thanks for letting me know. 👍 (maybe internal ticket was opened by me or not 🙂 because #118 have some time now)
I know Link doesn't accept a nonce param, and like I've mentioned on the PR description this would only work if the needed changes are also applied to Link but for that one I haven't found a repo.
Needed changes with this approach would be capture the nonce and then apply to any inline styles.
I've found no other way so far, can you confirm me that Link as it is only works allowing unsafe-inline?

Thank you

@seromenho seromenho changed the title Get and pass jss nonce to options if it exists CSP: Get and pass jss nonce to options if it exists Feb 4, 2021
@roypearce
Copy link

Any update on this @skylarmb ?

Companies shouldn't have to lower the security of their style CSP to unsafe-inline just to integrate Plaid into their product.

Defining a static nonce isn't great, but it's better than the alternative of unsafe-inline.

A more preferable alternative would be to have Plaid host the stylesheet so cdn.plaid.com could be defined a a style-src.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants