feat(material): Support CSP, headers with style-src 'self'
See original GitHub issueFeature Description
Our current CSP implementation contains style-src 'self'
which is not compatible with Angular Material. It would be great that Angular Material would support such CSP headers and, for example, as a solution have a possibility to add CSP nonces or would disable such inline injections. There was already an issue created before but was closed due to inactivity.
We have used ‘unsafe-hashes’ for some of the styles attributes but now, according to Dutch government, which we have to comply to, these should be removed.
If you think some workaround is possible or a minor fix in a code would do, it would be great to get that information. We could then maybe provide a pull request ourselves.
Use Case
This would enable use of strict CSP headers regarding styles.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:26
- Comments:12 (8 by maintainers)
Top Results From Across the Web
CSP: style-src - HTTP - MDN Web Docs - Mozilla
The HTTP Content-Security-Policy (CSP) style-src directive specifies valid sources for ... as well as styles loaded using the Link header:.
Read more >Content-Security-Policy Header CSP Reference & Examples
Defines valid sources of stylesheets or CSS. Example style-src Policy. style-src 'self' css.example.com; CSP Level 1 25+ ...
Read more >Content Security Policy (CSP) - Material UI - MUI
This section covers the details of setting up a CSP. ... header('Content-Security-Policy').set( `default-src 'self'; style-src 'self' 'nonce-${nonce}';`, );
Read more >Content Security Policy (CSP) Header Not Set - OWASP ZAP
Ensure that your web server, application server, load balancer, etc. is configured to set the Content-Security-Policy header, to achieve optimal browser support ......
Read more >Make Angular working with restrictive Content Security Policy ...
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; ... header-value="default-src 'self'; style-src 'self' 'unsafe-inline'"/> ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Angular itself has this problem: https://github.com/angular/angular/issues/6361
That issue being addressed would be a prereq for components to tackle this.
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.