Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/vuePublic

feat(ssr): add csp nonce to all elements#11826

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
blake-newman wants to merge1 commit intovuejs:main
base:main
Choose a base branch
Loading
fromblake-newman:blake.newman/improve-csp-nonce-support

Conversation

blake-newman
Copy link
Member

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

If yes, please describe the impact and migration path for existing applications:

The PR fulfills these requirements:

Other information:

CSPv3 allows simple nonce based policies and directives such asstict-dynamic. Declaring a policy such as:

Content-Security-Policy:  object-src 'none';  script-src 'nonce-{random}' 'unsafe-inline' 'unsafe-eval' 'strict-dynamic' https: http:;  base-uri 'none';  report-uri https://your-report-collector.example.com/

Would not work with current nonce support with features such as resource hints. This policy creates errors such as

Refused to load the script 'http://localhost:8082/manifest.js' because it violates the following Content Security Policy directive: "script-src 'self' 'nonce-68f9bed4d31fcde221e7b5e871860ff2' 'unsafe-inline' 'unsafe-eval' 'strict-dynamic' http:". 'strict-dynamic' is present, so host-based allowlisting is disabled. Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback.

This is because not all rendered elements have an associated nonce.

To support stricter policies that only work scripts / resource hinting addnonce attribute to all element that could be affected via a nonce based policy.

31453 and fjnuhz reacted with hooray emoji
Copy link

@ghostghost left a comment

Choose a reason for hiding this comment

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

LGTM

@blake-newman
Copy link
MemberAuthor

@posva is this good to merge - could be useful for many people. I forgot about this PR myself as we forked and patched the change.

@eliasjtg
Copy link

any update?

@blake-newman
Copy link
MemberAuthor

@posva@yyx990803

Is it possible to merge this as part of2.7 was planning to upgrade to this version and realised this PR was still left open. My bad should have nudged this sooner

@blake-newmanblake-newmanforce-pushed theblake.newman/improve-csp-nonce-support branch from8e40316 to8df91b8CompareNovember 28, 2022 14:36
add csp nonce to all elements that could potentiall be affected by CSP directives
@blake-newmanblake-newmanforce-pushed theblake.newman/improve-csp-nonce-support branch from8df91b8 to5449d9eCompareNovember 28, 2022 14:48
@blake-newmanblake-newman changed the base branch fromdev tomainNovember 28, 2022 14:49
@blake-newman
Copy link
MemberAuthor

@yyx990803 i've updated this to the main branch

@Ho3einTahan
Copy link

rt

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@posvaposvaposva approved these changes

Assignees
No one assigned
Labels
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@blake-newman@eliasjtg@Ho3einTahan@posva

[8]ページ先頭

©2009-2025 Movatter.jp