FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add trusted-types and require-trusted-types-for CSP Directive by KyFaSt · Pull Request #486 · github/secure_headers · GitHub

Add trusted-types and require-trusted-types-for CSP Directive - #486

Merged
KyFaSt merged 10 commits into
mainfrom
kyfast-add-trusted-types
Aug 2, 2022
Merged

Add trusted-types and require-trusted-types-for CSP Directive#486
KyFaSt merged 10 commits into
mainfrom
kyfast-add-trusted-types

Conversation

KyFaSt commented Jun 8, 2022

Copy link
Copy Markdown
Contributor

All PRs:

  • Has tests
  • Documentation updated

Adding a new CSP directive

This PR adds support for the TrustedTypes CSP directives, require-trusted-types-for and 'trusted-types'.

  • Is the directive supported by any user agent? If so, which?
    TrustedTypes are available in Chrome 83, Edge 83 and a polyfill exists for browsers that don't currently support.

  • What does it do?
    require-trusted-types-for disallows using strings with DOM XSS injection sink functions (functions like Document.write, Element.InnerHtml), and requires matching types created by Trusted Type policies.

  • What are the valid values for the directive
    require-trusted-types-for only allows script.
    trusted-types allows a list of strings, including one 'allow-duplicates' which allows multiples of the same named policy to be created.

KyFaSt requested a review from a team June 8, 2022 16:35
KyFaSt changed the title Kyfast add trusted types Add trusted-types and require-trusted-types-for CSP Directive Jun 8, 2022

lgarron left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Looks good to me!

A few small optional nits.

expect(csp.value).to eq("trusted-types blahblahpolicy")
end

it "allows duplicate policy names in trusted-types directive" do

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Would it make sense to test 'none' explicitly as well?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

yes, probably. I'll add that

KyFaSt force-pushed the kyfast-add-trusted-types branch from 1163c40 to 071c580 Compare June 28, 2022 13:29
KyFaSt merged commit 494b75f into main Aug 2, 2022
KyFaSt deleted the kyfast-add-trusted-types branch August 2, 2022 13:51
This file contains hidden or 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL