The inline styles generated by Emotion are conflicting with the CSP directives which disallow inline styles for security reasons. This results in styles not being applied, thereby affecting the user interface appearance.
Other information:
I found Emotion mentioned in the package.json file of React-Admin in node_modules but did not find any references in the react-admin files.
A security issue exists whenever you receive code from an untrusted source (e.g. a remote server) and execute it locally. As an example, consider a remote website being displayed inside a default BrowserWindow. If an attacker somehow manages to change said content (either by attacking the source directly, or by sitting between your app and the actual destination), they will be able to execute native code on the user's machine.
Environment
React-admin version: "react-admin": "^4.15.2"
Last version that did not exhibit the issue (if applicable): "react-admin": "^4.15.2"
React version: "react": "^18.2.0"
Browser:
Stack trace (in case of a JS error): emotion-sheet.browser.esm.js:132 Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'self' 'nonce-EsMIvREceQQUWqxLDlCXAA=='". Either the 'unsafe-inline' keyword, a hash ('sha256-wvs0Bxu6FqhzYbW2Jlatq2fHLP+5ZY+74Y2z/8gdHus='), or a nonce ('nonce-...') is required to enable inline execution.
What you were expecting:
I was expecting React-Admin to work seamlessly with Electron, adhering to the Content Security Policy (CSP) directives, especially when using Emotion for styling. It is based on https://www.electronjs.org/docs/latest/tutorial/security#6-define-a-content-security-policy
What happened instead:
The inline styles generated by Emotion are conflicting with the CSP directives which disallow inline styles for security reasons. This results in styles not being applied, thereby affecting the user interface appearance.
Steps to reproduce:
Related code:
Other information:
Other information: I found
Emotion
mentioned in thepackage.json
file of React-Admin innode_modules
but did not find any references in the react-admin files.Environment
emotion-sheet.browser.esm.js:132 Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'self' 'nonce-EsMIvREceQQUWqxLDlCXAA=='". Either the 'unsafe-inline' keyword, a hash ('sha256-wvs0Bxu6FqhzYbW2Jlatq2fHLP+5ZY+74Y2z/8gdHus='), or a nonce ('nonce-...') is required to enable inline execution.