René's URL Explorer Experiment


Title: `content_security_policy_nonce` calls Rails method so CSP does not contain nonce · Issue #511 · github/secure_headers · GitHub

Open Graph Title: `content_security_policy_nonce` calls Rails method so CSP does not contain nonce · Issue #511 · github/secure_headers

X Title: `content_security_policy_nonce` calls Rails method so CSP does not contain nonce · Issue #511 · github/secure_headers

Description: Expected outcome I am using GoodJob to process jobs on Rails 6. The GoodJob dashboard includes a number of scripts and styles. These all have nonces set using the content_security_policy_nonce method. <%= tag.script "", src: frontend_sta...

Open Graph Description: Expected outcome I am using GoodJob to process jobs on Rails 6. The GoodJob dashboard includes a number of scripts and styles. These all have nonces set using the content_security_policy_nonce meth...

X Description: Expected outcome I am using GoodJob to process jobs on Rails 6. The GoodJob dashboard includes a number of scripts and styles. These all have nonces set using the content_security_policy_nonce meth...

Opengraph URL: https://github.com/github/secure_headers/issues/511

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`content_security_policy_nonce` calls Rails method so CSP does not contain nonce","articleBody":"### Expected outcome\r\nI am using GoodJob to process jobs on Rails 6. The GoodJob dashboard includes a number of scripts and styles. These all have nonces set using the `content_security_policy_nonce` method.\r\n```\r\n \u003c%= tag.script \"\", src: frontend_static_path(:bootstrap, format: :js, v: GoodJob::VERSION, locale: nil), nonce: content_security_policy_nonce %\u003e\r\n```\r\n\r\n([link to code](https://github.com/bensheldon/good_job/blob/c71c3b338326bc14fb0ec58eaf70f6ee66c20c02/app/views/layouts/good_job/application.html.erb#L14))\r\n\r\nI would expect Secure Headers to set the nonce in the CSP header so that these scripts are permitted.\r\n\r\n### Actual outcome\r\n\r\nNo nonce is set in the CSP header. I think that Rails' own `content_security_policy_nonce` method is being called rather than the Secure Headers method of the same name. This means that the CSP set by Secure Headers doesn't include the nonce, and the scripts and styles are therefore not permitted.\r\n\r\nI know that recommend practice when using Secure Headers is to use the `nonced_javascript_tag` method, but since this is in a gem I can't do that.\r\n\r\nPossible related issues:\r\n- https://github.com/github/secure_headers/issues/392\r\n- https://github.com/github/secure_headers/pull/389\r\n\r\n### Config\r\n\r\n```\r\nSecureHeaders::Configuration.default do |config|\r\n  config.hsts = \"max-age=#{1.year.to_i}; includeSubDomains; preload\"\r\n  config.x_frame_options = 'DENY'\r\n  config.x_content_type_options = 'nosniff'\r\n  config.x_xss_protection = '1; mode=block'\r\n  config.x_download_options = 'noopen'\r\n  config.x_permitted_cross_domain_policies = 'none'\r\n  config.referrer_policy = %w[origin-when-cross-origin\r\n                              strict-origin-when-cross-origin]\r\n  config.csp = {\r\n    default_src: %w['none'],\r\n    script_src: %w['self' http://www.google-analytics.com],\r\n    connect_src: %w['self'],\r\n    frame_ancestors: %w['none'],\r\n    font_src: %w['self' data: https://fonts.gstatic.com],\r\n    img_src: %w['self' data: https://validator.swagger.io],\r\n    style_src: %w['self' https://fonts.googleapis.com],\r\n  }\r\nend\r\n```\r\n\r\n### Generated headers\r\n\r\n```\r\ndefault-src 'none'; connect-src 'self'; font-src 'self' data: fonts.gstatic.com; frame-ancestors 'none'; img-src 'self' data: validator.swagger.io; script-src 'self' www.google-analytics.com; style-src 'self' fonts.googleapis.com\r\n```\r\n","author":{"url":"https://github.com/jdudley1123","@type":"Person","name":"jdudley1123"},"datePublished":"2023-09-20T12:50:27.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/511/secure_headers/issues/511"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:8c35d767-054a-f2b4-836b-22238b458e25
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idDD66:2E67B:183EDE5:20E3045:6964B05A
html-safe-nonced4e993f027ae1238b0bc175091cf4dc4e9aebf128534fc40f0a04b347a9979f3
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERDY2OjJFNjdCOjE4M0VERTU6MjBFMzA0NTo2OTY0QjA1QSIsInZpc2l0b3JfaWQiOiI2NDc0NDk3ODA5ODg3NTcyMDU4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac80251313e6aaf6525e1e057a4620fe21e8759235ee1003590f82c6142bcbd463
hovercard-subject-tagissue:1904928906
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/github/secure_headers/511/issue_layout
twitter:imagehttps://opengraph.githubassets.com/a3f373a6e310c9c3cf9ee70d331a1fc34ffe7063d1eaf177fb9a0d381cd98f5f/github/secure_headers/issues/511
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/a3f373a6e310c9c3cf9ee70d331a1fc34ffe7063d1eaf177fb9a0d381cd98f5f/github/secure_headers/issues/511
og:image:altExpected outcome I am using GoodJob to process jobs on Rails 6. The GoodJob dashboard includes a number of scripts and styles. These all have nonces set using the content_security_policy_nonce meth...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamejdudley1123
hostnamegithub.com
expected-hostnamegithub.com
None15579c46431b7fd25941c3b09010f74fd1890c7a35226839bbbf40ce70fb3057
turbo-cache-controlno-preview
go-importgithub.com/github/secure_headers git https://github.com/github/secure_headers.git
octolytics-dimension-user_id9919
octolytics-dimension-user_logingithub
octolytics-dimension-repository_id7122663
octolytics-dimension-repository_nwogithub/secure_headers
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id7122663
octolytics-dimension-repository_network_root_nwogithub/secure_headers
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release499abb347cb197601d399c346cfeb4b3fa135d5c
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/github/secure_headers/issues/511#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgithub%2Fsecure_headers%2Fissues%2F511
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgithub%2Fsecure_headers%2Fissues%2F511
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=github%2Fsecure_headers
Reloadhttps://github.com/github/secure_headers/issues/511
Reloadhttps://github.com/github/secure_headers/issues/511
Reloadhttps://github.com/github/secure_headers/issues/511
github https://github.com/github
secure_headershttps://github.com/github/secure_headers
Notifications https://github.com/login?return_to=%2Fgithub%2Fsecure_headers
Fork 253 https://github.com/login?return_to=%2Fgithub%2Fsecure_headers
Star 3.3k https://github.com/login?return_to=%2Fgithub%2Fsecure_headers
Code https://github.com/github/secure_headers
Issues 14 https://github.com/github/secure_headers/issues
Pull requests 7 https://github.com/github/secure_headers/pulls
Actions https://github.com/github/secure_headers/actions
Projects 0 https://github.com/github/secure_headers/projects
Models https://github.com/github/secure_headers/models
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/github/secure_headers/security
Please reload this pagehttps://github.com/github/secure_headers/issues/511
Insights https://github.com/github/secure_headers/pulse
Code https://github.com/github/secure_headers
Issues https://github.com/github/secure_headers/issues
Pull requests https://github.com/github/secure_headers/pulls
Actions https://github.com/github/secure_headers/actions
Projects https://github.com/github/secure_headers/projects
Models https://github.com/github/secure_headers/models
Security https://github.com/github/secure_headers/security
Insights https://github.com/github/secure_headers/pulse
New issuehttps://github.com/login?return_to=https://github.com/github/secure_headers/issues/511
New issuehttps://github.com/login?return_to=https://github.com/github/secure_headers/issues/511
#571https://github.com/github/secure_headers/pull/571
content_security_policy_nonce calls Rails method so CSP does not contain noncehttps://github.com/github/secure_headers/issues/511#top
#571https://github.com/github/secure_headers/pull/571
https://github.com/fletchto99
https://github.com/copilot-swe-agent
https://github.com/jdudley1123
https://github.com/jdudley1123
jdudley1123https://github.com/jdudley1123
on Sep 20, 2023https://github.com/github/secure_headers/issues/511#issue-1904928906
link to codehttps://github.com/bensheldon/good_job/blob/c71c3b338326bc14fb0ec58eaf70f6ee66c20c02/app/views/layouts/good_job/application.html.erb#L14
Method conflicting content_security_policy_nonce with Rails 5.2 #392https://github.com/github/secure_headers/issues/392
Avoid calling content_security_policy_nonce internally #389https://github.com/github/secure_headers/pull/389
Copilothttps://github.com/apps/copilot-swe-agent
fletchto99https://github.com/fletchto99
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.