[bug]: support nonces for usage of inline CSS required for certain components to work, currently incompatibility when using a Content Security Policy (CSP) that doesn't add unsafe-inline for CSS #4461
Labels
bug
Something isn't working
Describe the bug
Certain components don't work when unsafe-inline is not defined in the CSP, a security incompatibility that should be resolved so shadcn can also be used by development teams under strict security requirements. I hope the shadcn team also takes security seriously and wants to support this 🙏
If CSS can be injected by an attack, it can aid in social engineering attacks by confusing the target users.
Seems to be a problem with Toast as well as the third-part library Sonner: emilkowalski/sonner#449
This issue seems to remain closed even after requesting it to be re-opened: #2891
Affected component/components
Toast, Sonner, Tabs, Dialog, Sheet, Command
How to reproduce
Use any CSP with the
style-src
directive set to anything other thanunsafe-inline
.Codesandbox/StackBlitz link
No response
Logs
System Info
Before submitting
The text was updated successfully, but these errors were encountered: