-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This removes unsafe-inline from script and data images. It sets a nonce-generator which will apply to script-src. Having a nonce in a CSP will cause any unsafe-inline rules to be ignored, so if an app needs them they will have to both add the directive unsafe-inline to script-src and also disable the nonce-generator. I initially planned for this to remove unsafe-inline from style as well, however I learnt in the latter stages of testing, that there is Govspeak that uses inline style attributes [1][2] (example page: [3]). I have ideas on how to fix this but it will take some time, so I'm deferring this until later. [1]: https://kramdown.gettalong.org/syntax.html#tables [2]: https://github.com/alphagov/govspeak/blob/5642fcc4231f215d1c58ad7feb30ca42fb8cfb91/lib/govspeak/html_sanitizer.rb#L72-L73 [3]: https://www.gov.uk/government/statistics/non-association-independent-schools-inspections-and-outcomes-in-england-august-2022/main-findings-non-association-independent-schools-inspections-and-outcomes-in-england-august-2022
- Loading branch information
Showing
2 changed files
with
26 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters