question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[V2] Request/Bug: Needs CSP Considerations

See original GitHub issue

We use a pretty strict CSP which doesn’t allow unsafe-inline for style-src. Therefore, when we try to use react-select we get the following errors (and an un-styled react-select component):

Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'self' Note that 'unsafe-inline' is ignored if either a hash or nonce value is present in the source list.

Unfortunately this is blocking us from using this wonderful component!

I noticed this old issue: https://github.com/JedWatson/react-select/issues/2030, but the props autosize and inputProps have been removed in v2.

EDIT: It looks maybe the best way to add support for this is by using create-emotion which includes the ability to use a single <style> tag with a nonce attribute?

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:15
  • Comments:17

github_iconTop GitHub Comments

6reactions
edmorleycommented, Feb 6, 2019

Hi! My concerns were:

  1. That unless the messaging was clear, it would be easy for users to think #3260 was the correct solution even when using static hard coded CSP headers (and not realise doing so would be a security issue) ie: footgun potential.
  2. That by closing this issue it might suggest it was resolved, when really what some of us would like is for emotion support to be optional, and to have a way to disable inline styles entirely.
4reactions
richmeijcommented, Jul 10, 2020

Hi, Im using Creatable in a project, and its not clear to me how to set/pass a nonce to react-select. Is there any documentation regarding this? Or maybe its possible to disable injecting CSS?

Read more comments on GitHub >

github_iconTop Results From Across the Web

1254194 - Support CSP in WebExtensions - Bugzilla@Mozilla
WebExtension pages should have a fairly strict default CSP. We should probably re-use the same policy we currently use for privileged apps.
Read more >
143653 – Implement CSP upgrade-insecure-requests directive
I have a few questions about the current patch: 1. Should we be applying the upgrade logic to outbound targets? I assumed that...
Read more >
CSP Authorization Playbook - Vol. I & II - FedRAMP
Demand is a key consideration for CSPs deciding between pursuing a JAB P-ATO or ATO from an agency partner. FedRAMP generally evaluates CSOs ......
Read more >
Request a credit from Microsoft - Partner Center
Considerations ; Request credit; Types of credits; Next steps ... This article explains how Cloud Solution Provider (CSP) direct and indirect ...
Read more >
Microsoft's New Commerce Experience (NCE) for CSP - Pax8
Microsoft's Cloud Solution Provider (CSP) program continues to evolve as ... If you need to process a 2:1 upgrade, please contact your Pax8 ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found