-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
feat(material): Support CSP, headers with style-src 'self' #24633
Comments
This feature request is now candidate for our backlog! In the next phase, the community has 60 days to upvote. If the request receives more than 20 upvotes, we'll move it to our consideration list. You can find more details about the feature request process in our documentation. |
Angular itself has this problem: angular/angular#6361 That issue being addressed would be a prereq for components to tackle this. |
@jelbourn I have seen this but having in mind that it's open for around 6 years already is quite concerning. Am I right by saying that Angular Material is using Angular style injection infrastructure? Maybe it's possible to add, for example, nonces as attributes from Angular Material side? At the moment we're using a custom shared_styles_host implementation but it is a hacky and not future proof way to tackle the issue, especially given the fact that Angular themselves have made some workarounds where they just inject style node into the DOM, bypassing the mentioned host. |
Yes, Angular Material is built with Angular and shows this issue, the same as any other Angular-authored components. The issue is old, but it has never been a high priority because Google's security engineering team doesn't deem |
How about possibility to add, for example, nonces as attributes from Angular Material side? |
The component library would have to stop using Angular's |
Can you maybe point me to the place where such APIs are used in Angular Material? Maybe I could see some solution or a workaround |
It's in every component's |
@jelbourn Is this something we would even consider changing on our end? Seems like if this were to be done it would be handled by the framework, right? |
Yeah, I would really consider this a duplicate of that framework issue. |
Closing as a duplicate of angular/angular#6361 |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Feature 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.
The text was updated successfully, but these errors were encountered: